public SocketOperationStreamExecutor(
     Func <CancellationToken, Task <ISocketConnection> > connectionFactory,
     ISubscriptionManager subscriptionManager,
     IResultParserResolver resultParserResolver)
 {
     _connectionFactory = connectionFactory
                          ?? throw new ArgumentNullException(nameof(connectionFactory));
     _subscriptionManager = subscriptionManager
                            ?? throw new ArgumentNullException(nameof(subscriptionManager));
     _resultParserResolver = resultParserResolver
                             ?? throw new ArgumentNullException(nameof(resultParserResolver));
 }
Beispiel #2
0
        public SocketOperationStreamExecutorFactory(
            string name,
            Func <string, CancellationToken, Task <ISocketConnection> > connectionFactory,
            ISubscriptionManager subscriptionManager,
            IResultParserResolver 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));
            _resultParserResolver = resultParserResolver
                                    ?? throw new ArgumentNullException(nameof(resultParserResolver));
        }