Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 /// <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);