public ConsumerChannel( ulong id, uint messagePrefetchCount, AsyncQueue <MessagePackage> queue, IConnection connection, BatchHandler batchHandler, IEnumerable <IDecompressorFactory> decompressorFactories) { _id = id; _queue = queue; _connection = connection; _batchHandler = batchHandler; _decompressors = new IDecompress[5]; foreach (var decompressorFactory in decompressorFactories) { _decompressors[(int)decompressorFactory.CompressionType] = decompressorFactory.Create(); } _lock = new AsyncLock(); _cachedCommandFlow = new CommandFlow { ConsumerId = id, MessagePermits = messagePrefetchCount }; _sendWhenZero = 0; _firstFlow = true; }
/// <summary>Mark this as an outgoing command, and assign it to be sent on <paramref name="theNVT"/></summary> internal TelnetCommand OutgoingOn(TelnetNVT theNVT) { direction = CommandFlow.Outgoing; terminal = theNVT; return(this); }
public static BaseCommand ToBaseCommand(this CommandFlow value) { return(new BaseCommand { type = BaseCommand.Type.Flow, Flow = value }); }
public static BaseCommand AsBaseCommand(this CommandFlow command) { return(new BaseCommand { CommandType = BaseCommand.Type.Flow, Flow = command }); }
/// <summary>Mark this as a command incoming on <paramref name="theNVT"/>, and parse its contents</summary> internal TelnetCommand IncomingOn(TelnetNVT theNVT) { direction = CommandFlow.Incoming; terminal = theNVT; Parse(); #if TelnetCommandLogging Debug.WriteLine("IN: " + humanReadableForm()); #endif return(this); }
public ConsumerChannel( ulong id, uint messagePrefetchCount, AsyncQueue <MessagePackage> queue, IConnection connection, BatchHandler batchHandler) { _id = id; _queue = queue; _connection = connection; _batchHandler = batchHandler; _cachedCommandFlow = new CommandFlow { ConsumerId = id, MessagePermits = messagePrefetchCount }; _sendWhenZero = 0; _firstFlow = true; }
public ConsumerStream( ulong id, uint messagePrefetchCount, IDequeue <MessagePackage> dequeue, Connection connection, IFaultStrategy faultStrategy, IConsumerProxy proxy, BatchHandler batchHandler) { _id = id; _dequeue = dequeue; _connection = connection; _faultStrategy = faultStrategy; _proxy = proxy; _batchHandler = batchHandler; _cachedCommandFlow = new CommandFlow { ConsumerId = id, MessagePermits = messagePrefetchCount }; _sendWhenZero = 0; _firstFlow = true; }
public Task Send(CommandFlow command, CancellationToken cancellationToken) => Send(command.AsBaseCommand(), cancellationToken);
public Builder() { _flow = new CommandFlow(); }
public async Task Send(CommandFlow command) => await Send(command.AsBaseCommand());