예제 #1
0
 public static BaseCommand ToBaseCommand(this CommandActiveConsumerChange value)
 {
     return(new BaseCommand
     {
         type = BaseCommand.Type.ActiveConsumerChange,
         ActiveConsumerChange = value
     });
 }
예제 #2
0
        public static ReadOnlySequence <byte> NewActiveConsumerChange(long consumerId, bool isActive)
        {
            var change = new CommandActiveConsumerChange {
                ConsumerId = (ulong)consumerId, IsActive = isActive
            };

            return(Serializer.Serialize(change.ToBaseCommand()));
        }
예제 #3
0
        public void Incoming(CommandActiveConsumerChange command)
        {
            var channel = _consumerChannels[command.ConsumerId];

            if (channel is null)
            {
                return;
            }

            if (command.IsActive)
            {
                channel.Activated();
            }
            else
            {
                channel.Deactivated();
            }
        }
예제 #4
0
 public Builder()
 {
     _consumer = new CommandActiveConsumerChange();
 }