public static BaseCommand ToBaseCommand(this CommandActiveConsumerChange value) { return(new BaseCommand { type = BaseCommand.Type.ActiveConsumerChange, ActiveConsumerChange = value }); }
public static ReadOnlySequence <byte> NewActiveConsumerChange(long consumerId, bool isActive) { var change = new CommandActiveConsumerChange { ConsumerId = (ulong)consumerId, IsActive = isActive }; return(Serializer.Serialize(change.ToBaseCommand())); }
public void Incoming(CommandActiveConsumerChange command) { var channel = _consumerChannels[command.ConsumerId]; if (channel is null) { return; } if (command.IsActive) { channel.Activated(); } else { channel.Deactivated(); } }
public Builder() { _consumer = new CommandActiveConsumerChange(); }