Class AsyncActionFactory<TTuple>
Provides a way of invoking an Action delegate regardless of the amount of parameters provided.
public sealed class AsyncActionFactory<TTuple> : MutableTupleFactory<TTuple> where TTuple : MutableTuple
  Type Parameters
TTupleThe type of the n-tuple representation of a MutableTuple.
- Inheritance
 - 
      
      MutableTupleFactory<TTuple>AsyncActionFactory<TTuple>
 
- Inherited Members
 
Constructors
AsyncActionFactory(Func<TTuple, CancellationToken, Task>, TTuple)
Initializes a new instance of the AsyncActionFactory<TTuple> class.
public AsyncActionFactory(Func<TTuple, CancellationToken, Task> method, TTuple tuple)
  Parameters
methodFunc<TTuple, CancellationToken, Task>The Task based function delegate to invoke.
tupleTTupleThe n-tuple argument of
method.
AsyncActionFactory(Func<TTuple, CancellationToken, Task>, TTuple, Delegate)
Initializes a new instance of the AsyncActionFactory<TTuple> class.
public AsyncActionFactory(Func<TTuple, CancellationToken, Task> method, TTuple tuple, Delegate originalDelegate)
  Parameters
methodFunc<TTuple, CancellationToken, Task>The Task based function delegate to invoke.
tupleTTupleThe n-tuple argument of
method.originalDelegateDelegateThe original delegate wrapped by
method.
Methods
Clone()
Creates a shallow copy of the current AsyncActionFactory<TTuple> object.
public override MutableTupleFactory<TTuple> Clone()
  Returns
- MutableTupleFactory<TTuple>
 A new AsyncActionFactory<TTuple> that is a copy of this instance.
Remarks
When thread safety is required this is the method to invoke.
ExecuteMethodAsync(CancellationToken)
Executes the delegate associated with this instance.
public Task ExecuteMethodAsync(CancellationToken ct)
  Parameters
ctCancellationTokenThe token to monitor for cancellation requests. The default value is None.
Returns
- Task
 A task that represents the asynchronous operation.
Exceptions
- InvalidOperationException
 No delegate was specified on the factory.
- OperationCanceledException
 The
ctwas canceled.