コード例 #1
0
        private IRequestSender StartRequestSender(Client.Configuration configuration)
        {
            var self = SelfAs <IResponseChannelConsumer>();

            var requestSender = ChildActorFor <IRequestSender>(() => new RequestSenderProbeActor(configuration, self, _testId));

            return(requestSender);
        }
コード例 #2
0
        public ClientConsumerWorkerActor(Client.Configuration configuration)
        {
            _testId = configuration.HasTestInfo
                ? TestIdGenerator.IncrementAndGet().ToString()
                : EmptyTestId;

            _requestSender = StartRequestSender(configuration);
            _parser        = null;
        }
コード例 #3
0
 public RequestSenderProbeActor(Client.Configuration configuration, IResponseChannelConsumer consumer, string testId)
 {
     _channel     = ClientConsumerCommons.ClientChannel(configuration, consumer, Logger);
     _cancellable = Stage.Scheduler.Schedule(
         SelfAs <IScheduled <object?> >(),
         null,
         TimeSpan.FromMilliseconds(1),
         TimeSpan.FromMilliseconds(configuration.ProbeInterval));
     _buffer = new MemoryStream(configuration.WriteBufferSize);
 }
コード例 #4
0
 public State(
     Client.Configuration configuration,
     IClientRequestResponseChannel channel,
     ResponseParser?parser,
     ICancellable probe,
     MemoryStream buffer)
 {
     Configuration = configuration;
     Channel       = channel;
     Parser        = parser;
     Probe         = probe;
     Buffer        = buffer;
 }
コード例 #5
0
        public ClientCorrelatingRequesterConsumerActor(Client.Configuration configuration)
        {
            _state = new State(
                configuration,
                ClientConsumerCommons.ClientChannel(configuration, SelfAs <IResponseChannelConsumer>(), Logger),
                null,
                Stage.Scheduler.Schedule(
                    SelfAs <IScheduled <object?> >(),
                    null,
                    TimeSpan.FromMilliseconds(1),
                    TimeSpan.FromMilliseconds(configuration.ProbeInterval)),
                new MemoryStream(configuration.WriteBufferSize));

            _completables        = new Dictionary <string, ICompletesEventually>();
            _randomUuidGenerator = new RandomBasedGenerator();
        }
コード例 #6
0
        public static IClientRequestResponseChannel ClientChannel(
            Client.Configuration configuration,
            IResponseChannelConsumer consumer,
            ILogger logger)
        {
            if (configuration.IsSecure)
            {
                return(new SecureClientRequestResponseChannel(
                           configuration.AddressOfHost,
                           consumer,
                           configuration.ReadBufferPoolSize,
                           configuration.ReadBufferSize,
                           logger));
            }

            return(new BasicClientRequestResponseChannel(
                       configuration.AddressOfHost,
                       consumer,
                       configuration.ReadBufferPoolSize,
                       configuration.ReadBufferSize,
                       logger));
        }
コード例 #7
0
 public LoadBalancingClientRequestConsumerActor(
     Client.Configuration configuration,
     RouterSpecification <IClientConsumer> specification)
     : base(specification)
 {
 }
コード例 #8
0
 /// <summary>
 /// Constructs my default state.
 /// </summary>
 /// <param name="configuration">The <see cref="Configuration"/></param>
 /// <param name="specification">The <see cref="RouterSpecification{T}"/></param>
 /// <exception cref="Exception">When the router cannot be initialized</exception>
 public RoundRobinClientRequestConsumerActor(Client.Configuration configuration, RouterSpecification <IClientConsumer> specification) : base(specification)
 {
 }