OperationWorkflowBase<TWorkflow, TArguments, TResult>

Namespace: SnowBank.Threading.Operations · class

Implements: IOperationWorkflow<TWorkflow, TArguments, TResult>, IOperationWorkflow<TArguments, TResult>, IOperationWorkflow

Generic implementation for Workflows

Methods

CreateInstance

static TWorkflow CreateInstance(IServiceProvider services, IOperationContext ctx)

Creates a new instance of this workflow, using an already created operation context.

  • services — Provider that can be used to instantiate this workflow
  • ctx — Context that will run this operation

Returns: New workflow instance that is ready to run an operation using the specified context.

static TWorkflow CreateInstance(IServiceProvider services, string name, IOperationScheduler scheduler, CancellationToken ct)

Creates a new instance of this workflow

  • services — Provider that can be used to instantiate this workflow
  • name — Name of the workflow
  • scheduler — Scheduler that will be used to run this operation
  • ct — Token that can be used to cancel this operation

Returns: New workflow instance that is ready to run an operation using a newly created context.

ExecuteAsync

Task<OperationResult<TResult>> ExecuteAsync(TArguments arguments)