public HttpOperationExecutor(
     Func <HttpClient> clientFactory,
     OperationDelegate <IHttpOperationContext> executeOperation,
     IOperationFormatter operationFormatter,
     IResultParserCollection resultParserResolver)
 {
     _clientFactory = clientFactory
                      ?? throw new ArgumentNullException(nameof(clientFactory));
     _executeOperation = executeOperation
                         ?? throw new ArgumentNullException(nameof(executeOperation));
     _operationFormatter = operationFormatter
                           ?? throw new ArgumentNullException(nameof(operationFormatter));
     _resultParserResolver = resultParserResolver
                             ?? throw new ArgumentNullException(nameof(resultParserResolver));
 }
 public SocketOperationStreamExecutor(
     Func <CancellationToken, Task <ISocketConnection> > connectionFactory,
     ISubscriptionManager subscriptionManager,
     IOperationFormatter operationFormatter,
     IResultParserCollection resultParserResolver)
 {
     _connectionFactory = connectionFactory
                          ?? throw new ArgumentNullException(nameof(connectionFactory));
     _subscriptionManager = subscriptionManager
                            ?? throw new ArgumentNullException(nameof(subscriptionManager));
     _operationFormatter = operationFormatter
                           ?? throw new ArgumentNullException(nameof(operationFormatter));
     _resultParserResolver = resultParserResolver
                             ?? throw new ArgumentNullException(nameof(resultParserResolver));
 }
        public HttpOperationExecutorFactory(
            string name,
            Func <string, HttpClient> clientFactory,
            OperationDelegate <IHttpOperationContext> executeOperation,
            IOperationFormatter operationFormatter,
            IResultParserCollection resultParserResolver)
        {
            if (clientFactory is null)
            {
                throw new ArgumentNullException(nameof(clientFactory));
            }

            Name = name
                   ?? throw new ArgumentNullException(nameof(name));
            _clientFactory    = () => clientFactory(name);
            _executeOperation = executeOperation
                                ?? throw new ArgumentNullException(nameof(executeOperation));
            _operationFormatter = operationFormatter
                                  ?? throw new ArgumentNullException(nameof(operationFormatter));
            _resultParserResolver = resultParserResolver
                                    ?? throw new ArgumentNullException(nameof(resultParserResolver));
        }
Exemplo n.º 4
0
        public SocketOperationStreamExecutorFactory(
            string name,
            Func <string, CancellationToken, Task <ISocketConnection> > connectionFactory,
            ISubscriptionManager subscriptionManager,
            IOperationFormatter operationFormatter,
            IResultParserCollection resultParserResolver)
        {
            if (connectionFactory is null)
            {
                throw new ArgumentNullException(nameof(connectionFactory));
            }

            Name = name
                   ?? throw new ArgumentNullException(nameof(name));
            _connectionFactory   = ct => connectionFactory(name, ct);
            _subscriptionManager = subscriptionManager
                                   ?? throw new ArgumentNullException(nameof(subscriptionManager));
            _operationFormatter = operationFormatter
                                  ?? throw new ArgumentNullException(nameof(operationFormatter));
            _resultParserResolver = resultParserResolver
                                    ?? throw new ArgumentNullException(nameof(resultParserResolver));
        }