ClientSessionTask( string description, bool isSuccessfulCompletionRequired, ClientSessionTaskDelegate @delegate, ClientSessionTaskExceptionHandler exceptionHandler) { if (description == null) { throw new ArgumentNullException(nameof(description)); } if (@delegate == null) { throw new ArgumentNullException(nameof(@delegate)); } Description = description; IsSuccessfulCompletionRequired = isSuccessfulCompletionRequired; Delegate = @delegate; ExceptionHandler = exceptionHandler; }
/// <summary> /// Creates a <see cref="T:ClientSessionTask"/> that can recover from /// failure but cannot be cancelled while executing <param name="delegate"/>. /// </summary> public static ClientSessionTask Create( string description, ClientSessionTaskDelegate @delegate, ClientSessionTaskExceptionHandler exceptionHandler = null) => new ClientSessionTask(description, false, @delegate, exceptionHandler);