private FromBytes ( byte data, TraceSource trace ) : |
||
data | byte | |
trace | TraceSource | |
Résultat |
private void OnMessage(string key, byte[] data) { // The key is the stream id (channel) var message = RedisMessage.FromBytes(data); OnReceived(0, (ulong)message.Id, message.Messages); }
public async Task SubscribeAsync(string key, Action <int, RedisMessage> onMessage) { await _redisSubscriber.SubscribeAsync(key, (channel, data) => { var message = RedisMessage.FromBytes(data, _logger); onMessage(0, message); _latestMessageId = message.Id; }); }
public async Task SubscribeAsync(string key, Action <int, RedisMessage> onMessage) { await _redisSubscriber.SubscribeAsync(key, (channel, data) => { var message = RedisMessage.FromBytes(data, _trace); onMessage(0, message); // Save the last message id in just in case redis shuts down _latestMessageId = message.Id; }); }
public async Task SubscribeAsync(string key, Action <int, RedisMessage> onMessage) { _trace.TraceInformation("Subscribing to key: " + key); await _redisSubscriber.SubscribeAsync(key, (channel, data) => { var message = RedisMessage.FromBytes(_messageEncryptor, data, _trace); onMessage(0, message); // Save the last message id in just in case redis shuts down _latestMessageId = message.Id; }); }
private void OnMessage(string key, byte[] data) { // locked to avoid overlapping calls (even though we have set the mode // to preserve order on the subscription) lock (_callbackLock) { // The key is the stream id (channel) var message = RedisMessage.FromBytes(data); OnReceived(0, message.Id, message.ScaleoutMessage); } }