Ejemplo n.º 1
0
      public SampleCommand(
          IoSession session,
          TimeoutNotifyProducerConsumer<AbstractAsyncCommand> producer)
          :base(session, CommandCode.Test, producer)
      {
 
      }
Ejemplo n.º 2
0
 public AbstractBlockCommand(
     IoSession session,
     CommandCode commandCode,
     TimeoutNotifyProducerConsumer<AbstractAsyncCommand> producer)
     :base(session, commandCode, producer)
 {
     Callback += BlockCommand_Callback;
 }
Ejemplo n.º 3
0
 public AbstractBlockCommand(
     IoSession session,
     CommandCode commandCode,
     TimeoutNotifyProducerConsumer <AbstractAsyncCommand> producer)
     : base(session, commandCode, producer)
 {
     Callback += BlockCommand_Callback;
 }
Ejemplo n.º 4
0
 protected AbstractAsyncCommand(
     IoSession session,
     CommandCode commandCode,
     TimeoutNotifyProducerConsumer <AbstractAsyncCommand> producer)
 {
     this.session     = session;
     this.CommandCode = commandCode;
     this.producer    = producer;
     this.ID          = Guid.NewGuid().ToByteArray().ToBase64();
     this.Version     = MessageVersion.V1;
 }
Ejemplo n.º 5
0
 public SampleCommand(
     IoSession session,
     TimeoutNotifyProducerConsumer <AbstractAsyncCommand> producer)
     : base(session, CommandCode.Test, producer)
 {
 }
Ejemplo n.º 6
0
 public Heartbeat(
     IoSession session,
     TimeoutNotifyProducerConsumer <AbstractAsyncCommand> producer)
     : base(session, CommandCode.Heartbeat, producer)
 {
 }
Ejemplo n.º 7
0
 public Authentication(
     IoSession session,
     TimeoutNotifyProducerConsumer <AbstractAsyncCommand> producer)
     : base(session, CommandCode.Authentication, producer)
 {
 }
Ejemplo n.º 8
0
 public Register(
     IoSession session,
     TimeoutNotifyProducerConsumer<AbstractAsyncCommand> producer)
     : base(session, CommandCode.Register, producer)
 { }
Ejemplo n.º 9
0
 public Authentication(
     IoSession session,
     TimeoutNotifyProducerConsumer<AbstractAsyncCommand> producer)
     : base(session, CommandCode.Authentication, producer)
 { }
Ejemplo n.º 10
0
 public ListConnectors(
     IoSession session,
     TimeoutNotifyProducerConsumer<AbstractAsyncCommand> producer)
     : base(session, CommandCode.ListConnectors, producer)
 { }
Ejemplo n.º 11
0
 public ListConnectors(
     IoSession session,
     TimeoutNotifyProducerConsumer <AbstractAsyncCommand> producer)
     : base(session, CommandCode.ListConnectors, producer)
 {
 }
Ejemplo n.º 12
0
 public Heartbeat(
 IoSession session,
 TimeoutNotifyProducerConsumer<AbstractAsyncCommand> producer)
     : base(session, CommandCode.Heartbeat, producer) { }
Ejemplo n.º 13
0
        public BaseConsumerTask(ConsumerContext context, int partitionId, int localCacheSize)
        {
            Context = context;
            PartitionId = partitionId;
            msgs = new BlockingQueue<IConsumerMessage>(localCacheSize);

            LeaseManager = ComponentLocator.Lookup<ILeaseManager<ConsumerLeaseKey>>(BuildConstants.CONSUMER);
            ConsumerNotifier = ComponentLocator.Lookup<IConsumerNotifier>();
            EndpointClient = ComponentLocator.Lookup<IEndpointClient>();
            EndpointManager = ComponentLocator.Lookup<IEndpointManager>();
            MessageCodec = ComponentLocator.Lookup<IMessageCodec>();
            SystemClockService = ComponentLocator.Lookup<ISystemClockService>();
            Config = ComponentLocator.Lookup<ConsumerConfig>();
            retryPolicy = ComponentLocator.Lookup<IMetaService>().FindRetryPolicyByTopicAndGroup(
                context.Topic.Name, context.GroupId);
            PullMessageResultMonitor = ComponentLocator.Lookup<IPullMessageResultMonitor>();

            pullMessageTaskExecutor = new ProducerConsumer<BasePullMessagesTask>(int.MaxValue);
            pullMessageTaskExecutor.OnConsume += RunPullMessageTask;

            renewLeaseTaskExecutor = new TimeoutNotifyProducerConsumer<RenewLeaseTask>(int.MaxValue);
            renewLeaseTaskExecutor.OnConsume += RunRenewLeaseTask;
        }
Ejemplo n.º 14
0
 public Register(
     IoSession session,
     TimeoutNotifyProducerConsumer <AbstractAsyncCommand> producer)
     : base(session, CommandCode.Register, producer)
 {
 }
Ejemplo n.º 15
0
 public CommandHandler(TimeoutNotifyProducerConsumer<AbstractAsyncCommand> producer)
 {
     this.producer = producer;
 }
Ejemplo n.º 16
0
 public CommandHandler(TimeoutNotifyProducerConsumer <AbstractAsyncCommand> producer)
 {
     this.producer = producer;
 }