示例#1
0
 public Connection(IPulsarStream stream)
 {
     _lock                   = new AsyncLock();
     _channelManager         = new ChannelManager();
     _requestResponseHandler = new RequestResponseHandler();
     _pingPongHandler        = new PingPongHandler(this);
     _stream                 = stream;
 }
示例#2
0
 public Connection(Stream stream)
 {
     _lock                   = new AsyncLock();
     _producerManager        = new ProducerManager();
     _consumerManager        = new ConsumerManager();
     _requestResponseHandler = new RequestResponseHandler();
     _pingPongHandler        = new PingPongHandler(this);
     _stream                 = new PulsarStream(stream, HandleCommand);
 }
示例#3
0
 public ChannelManager()
 {
     _requestResponseHandler = new RequestResponseHandler();
     _consumerChannels       = new IdLookup <IChannel>();
     _producerChannels       = new IdLookup <IChannel>();
     _incoming = new EnumLookup <BaseCommand.Type, Action <BaseCommand> >(cmd => _requestResponseHandler.Incoming(cmd));
     _incoming.Set(BaseCommand.Type.CloseConsumer, cmd => Incoming(cmd.CloseConsumer));
     _incoming.Set(BaseCommand.Type.CloseProducer, cmd => Incoming(cmd.CloseProducer));
     _incoming.Set(BaseCommand.Type.ActiveConsumerChange, cmd => Incoming(cmd.ActiveConsumerChange));
     _incoming.Set(BaseCommand.Type.ReachedEndOfTopic, cmd => Incoming(cmd.ReachedEndOfTopic));
 }