Exemplo n.º 1
0
 public RedisTaskQueueBackend(string redisConnectionString, string queueName, string backupQueueName)
 {
     Redis           = ConnectionMultiplexer.Connect(redisConnectionString);
     RedisQueue      = new RedisQueue(Redis);
     QueueName       = queueName;
     BackupQueueName = backupQueueName;
 }
Exemplo n.º 2
0
        public void RemoveBackup(string jsonString)
        {
            if (jsonString == null)
            {
                return;
            }

            RedisQueue.Remove(BackupQueueName, jsonString);
        }
Exemplo n.º 3
0
        public string RestoreTopBackup()
        {
            var jsonString = RedisQueue.PopPush(BackupQueueName, QueueName);

            return(jsonString);
        }
Exemplo n.º 4
0
        public string PeekBackup()
        {
            var jsonString = RedisQueue.Peek(BackupQueueName);

            return(jsonString);
        }
Exemplo n.º 5
0
        public string DequeueAndBackup()
        {
            var jsonString = RedisQueue.PopPush(QueueName, BackupQueueName);

            return(jsonString);
        }
Exemplo n.º 6
0
        public string Dequeue()
        {
            var jsonString = RedisQueue.Pop(QueueName);

            return(jsonString);
        }
Exemplo n.º 7
0
 public void Enqueue(string jsonString)
 {
     RedisQueue.Push(QueueName, jsonString);
 }
        public async Task <string> Dequeue()
        {
            var jsonString = await RedisQueue.Pop(QueueName);

            return(jsonString);
        }
 public async Task Enqueue(string jsonString)
 {
     await RedisQueue.Push(QueueName, jsonString);
 }
Exemplo n.º 10
0
 public RedisBackend(string redisConnectionString)
 {
     Redis      = ConnectionMultiplexer.Connect(redisConnectionString);
     RedisQueue = new RedisQueue(Redis);
 }