Runtime<T> 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.read-only - hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
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<
T> (String name) → Handler< T> -
Unregister a handler function Handler<T> 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. [...]
-
registerEvent<
T> (dynamic func) → void - Register an new event to be ingested by a handler. The type should reflect your type in your handler definition Handler<T>.
-
registerHandler<
T> (String name, Handler< T> handler) → Handler<T> -
Register a handler function Handler<T> with
name
which digests an eventT
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited