IExecutable class abstract

Interface for components that can be called to execute work.

See Executor See INotifiable See Parameters

Example

class EchoComponent implements IExecutable {
    ...
    Future<dynamic> execute(IContext? context, Parameters args)  {
       return Future.delayed(Duration(), (){
           return args.getAsObject('message');
       })
    }
}

var echo =  EchoComponent();
var message = 'Test';
echo.execute(Context.fromTraceId("123"), Parameters.fromTuples(['message', message])
   .then((result) {
        console.log('Request: ' + message + ' Response: ' + result);
    })
);

Constructors

IExecutable()

Properties

hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

execute(IContext? context, Parameters args) Future
Executes component with arguments and receives execution result.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited