private static void RetryRequest <T>(object state) { ExecutionState <T> executionState = (ExecutionState <T>)state; Logger.LogInformational(executionState.OperationContext, SR.TraceRetry); Executor.InitRequest(executionState); }
// Cancellation will be handled by a flag in the return type ( CancellationToken in .net4+ ) public static ICancellableAsyncResult BeginExecuteAsync <T>(RESTCommand <T> cmd, IRetryPolicy policy, OperationContext operationContext, AsyncCallback callback, object asyncState) { // Note all code below will reference state, not params directly, this will allow common code with async executor ExecutionState <T> executionState = new ExecutionState <T>(cmd, policy, operationContext, callback, asyncState); Executor.InitRequest(executionState); return(executionState); }