Class AsyncFuncFactory<TTuple, TResult>
Provides a way of invoking an Func<TResult> function delegate regardless of the amount of parameters provided.
public sealed class AsyncFuncFactory<TTuple, TResult> : MutableTupleFactory<TTuple> where TTuple : MutableTuple
  Type Parameters
TTupleThe type of the n-tuple representation of a MutableTuple.
TResultThe type of the return value of the function delegate Cuemon.Threading.AsyncFuncFactory<TTuple, TResult>.Method.
- Inheritance
 - 
      
      MutableTupleFactory<TTuple>AsyncFuncFactory<TTuple, TResult>
 
- Inherited Members
 
Constructors
AsyncFuncFactory(Func<TTuple, CancellationToken, Task<TResult>>, TTuple)
Initializes a new instance of the AsyncFuncFactory<TTuple, TResult> class.
public AsyncFuncFactory(Func<TTuple, CancellationToken, Task<TResult>> method, TTuple tuple)
  Parameters
methodFunc<TTuple, CancellationToken, Task<TResult>>The function delegate to invoke.
tupleTTupleThe n-tuple argument of
method.
AsyncFuncFactory(Func<TTuple, CancellationToken, Task<TResult>>, TTuple, Delegate)
Initializes a new instance of the AsyncFuncFactory<TTuple, TResult> class.
public AsyncFuncFactory(Func<TTuple, CancellationToken, Task<TResult>> method, TTuple tuple, Delegate originalDelegate)
  Parameters
methodFunc<TTuple, CancellationToken, Task<TResult>>The 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 AsyncFuncFactory<TTuple, TResult> object.
public override MutableTupleFactory<TTuple> Clone()
  Returns
- MutableTupleFactory<TTuple>
 A new AsyncFuncFactory<TTuple, TResult> that is a copy of this instance.
Remarks
When thread safety is required this is the method to invoke.
ExecuteMethodAsync(CancellationToken)
Executes the function delegate associated with this instance.
public Task<TResult> ExecuteMethodAsync(CancellationToken ct)
  Parameters
ctCancellationTokenThe token to monitor for cancellation requests. The default value is None.
Returns
- Task<TResult>
 A task that represents the asynchronous operation. The task result contains the return value of the function delegate associated with this instance.
Exceptions
- InvalidOperationException
 No delegate was specified on the factory.
- OperationCanceledException
 The
ctwas canceled.