예제 #1
0
 public RedisMessageStateHandler(IConnectionMultiplexer connection, RedisConfiguration configuration, RedisMessage <T> redisMessage, int deadLetterDeliveryLimit, IDependencyInjection messageScope)
 {
     _redisMessage           = redisMessage;
     _queueClient            = new RedisQueueClient <T>(connection.GetDatabase(configuration.DatabaseId), configuration.MessageSerializer);
     DeadLetterDeliveryLimit = deadLetterDeliveryLimit;
     MessageScope            = messageScope;
 }
예제 #2
0
 internal Task CompleteMessageAsync(RedisMessage <T> message)
 {
     return(Task.WhenAll(
                _db.KeyDeleteAsync(new RedisKey[] { message.HashKey, message.ExpirationKey }),
                _db.ListRemoveAsync(RedisQueueConventions.GetProcessingQueueName(_queueName), message.RedisValue, -1)));
 }
예제 #3
0
 private async Task ProcessMessageAsync(RedisMessage <T> redisMessage, CancellationToken cancellationToken)
 {
     var stateHandler = new RedisMessageStateHandler <T>(ConnectionMultiplexer, _redisConfiguration, redisMessage, _settings.DeadLetterDeliveryLimit, _queueName);
     await _processor.ProcessAsync(stateHandler, cancellationToken).ConfigureAwait(false);
 }
예제 #4
0
 public RedisMessageStateHandler(IConnectionMultiplexer connection, RedisConfiguration configuration, RedisMessage <T> redisMessage, int deadLetterDeliveryLimit, string queueName)
 {
     _db                     = connection.GetDatabase(configuration.DatabaseId);
     _redisMessage           = redisMessage;
     DeadLetterDeliveryLimit = deadLetterDeliveryLimit;
     _queueName              = queueName;
 }