Runtime class
A Runtime manages the interface to the Lambda API.
The Runtime is designed as singleton and Runtime.instance
returns the same instance of the Runtime everytime.
final Handler<AwsS3NotificationEvent> helloWorldHandler =
(context, event) async {
return new InvocationResult(context.requestId, "HELLO WORLD");
};
await Runtime.instance
..registerHandler<AwsS3NotificationEvent>("hello.world", helloWorld)
..invoke();
Note: You can register an
Constructors
- Runtime()
-
factory
Properties
-
handlers
→ List<
String> -
Lists the registered handlers by name.
The name is a simple String which reflects
the name of the trigger in the Lambda Execution API.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
deregisterEvent<
T> () → void - Deregister an new event to be ingested by a handler. The type should reflect your type in your handler definition Handler<T>.
-
deregisterHandler(
String name) → Handler? -
Unregister a handler function Handler with
name
. -
handlerExists(
String name) → bool - Checks if a specific handlers has been registered with the runtime.
-
invoke(
) → void - Run the Runtime in loop and digest events that are fetched from the AWS Lambda API Interface. The events are processed sequentially and are fetched from the AWS Lambda API Interface.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerEvent<
T> (T func(Map< String, dynamic> )) → void - Register an new event to be ingested by a handler. The type should reflect your type in your handler definition Handler<T>.
-
registerHandler<
E> (String name, Handler< E> handler) → Handler<E> -
Register a handler function Handler<T> with
name
which digests an eventT
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited