IExecutable

Interface that allows you to create a component that can be called to execute work.

Description

The IExecutable interface allows you to create a component that can be called to execute work.

Instance methods

ExecuteAsync

Executes component with arguments and receives execution result.

Task<object> ExecuteAsync(string correlationId, Parameters args)

  • correlationId: string - (optional) transaction id to trace execution through call chain.
  • args: Parameters - execution arguments.
  • returns: Task<object> - the execution result.

Examples

class EchoComponent: IExecutable 
{
    ...
    public void Execute(string correlationId, Parameters args)
    {
        var result = args.GetAsObject("message");
    }
}
var echo = new EchoComponent();
string message = "Test";
echo.Execute("123", Parameters.FromTuples("message", message));

See also