Contains the redis hash/key/etc names for a given queue name
예제 #1
0
 public VerifyQueueData(string queueName, QueueProducerConfiguration configuration, string connectionString)
 {
     _configuration = configuration;
     var connection = new BaseConnectionInformation(queueName, connectionString);
     _redisNames = new RedisNames(connection);
     _connection = new RedisConnection(connection);
 }
예제 #2
0
 public static void SetError(string queueName, string connectionString)
 {
     var connectionInfo = new BaseConnectionInformation(queueName, connectionString);
     var conn = new RedisConnection(connectionInfo);
     var redisNames = new RedisNames(connectionInfo);
     var db = conn.Connection.GetDatabase();
     var id = db.HashGet(redisNames.JobNames, "job1");
     db.HashSet(redisNames.Status, id,
        "2");
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisJobSchedulerLastKnownEvent" /> class.
        /// </summary>
        /// <param name="connection">The connection.</param>
        /// <param name="redisNames">The redis names.</param>
        public RedisJobSchedulerLastKnownEvent(
            IRedisConnection connection,
            RedisNames redisNames)
        {
            Guard.NotNull(() => connection, connection);
            Guard.NotNull(() => redisNames, redisNames);

            _connection = connection;
            _redisNames = redisNames;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisJobSchedulerLastKnownEvent" /> class.
        /// </summary>
        /// <param name="connection">The connection.</param>
        /// <param name="redisNames">The redis names.</param>
        public RedisJobSchedulerLastKnownEvent(
            IRedisConnection connection,
            RedisNames redisNames)
        {
            Guard.NotNull(() => connection, connection);
            Guard.NotNull(() => redisNames, redisNames);

            _connection = connection;
            _redisNames = redisNames;
        }
예제 #5
0
 public static void Verify(string queueName, string connectionString, long messageCount)
 {
     var connectionInfo = new BaseConnectionInformation(queueName, connectionString);
     var redisNames = new RedisNames(connectionInfo);
     using (var connection = new RedisConnection(connectionInfo))
     {
         var db = connection.Connection.GetDatabase();
         var records = db.HashLength(redisNames.Values);
         Assert.Equal(messageCount, records);
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueWorkSub"/> class.
        /// </summary>
        /// <param name="connection">The connection.</param>
        /// <param name="redisNames">The redis names.</param>
        /// <param name="cancelWork">The cancel work.</param>
        public RedisQueueWorkSub(IRedisConnection connection,
                                 RedisNames redisNames,
                                 IQueueCancelWork cancelWork)
        {
            Guard.NotNull(() => connection, connection);
            Guard.NotNull(() => redisNames, redisNames);
            Guard.NotNull(() => cancelWork, cancelWork);

            _connection = connection;
            _redisNames = redisNames;
            _cancelWork = cancelWork;
        }
예제 #7
0
 public void Create_Default()
 {
     var test = new RedisNames(CreateConnection());
     Assert.Contains("testQueue", test.Values);
     Assert.Contains("testQueue", test.Delayed);
     Assert.Contains("testQueue", test.Error);
     Assert.Contains("testQueue", test.Expiration);
     Assert.Contains("testQueue", test.Id);
     Assert.Contains("testQueue", test.MetaData);
     Assert.Contains("testQueue", test.Notification);
     Assert.Contains("testQueue", test.Pending);
     Assert.Contains("testQueue", test.Working);
     Assert.Contains("testQueue", test.Headers);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueCreation" /> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information.</param>
        /// <param name="redisConnection">The redis connection.</param>
        /// <param name="redisNames">The redis names.</param>
        /// <param name="creationScope">The creation scope.</param>
        public RedisQueueCreation(IConnectionInformation connectionInfo,
                                  IRedisConnection redisConnection,
                                  RedisNames redisNames,
                                  ICreationScope creationScope)
        {
            Guard.NotNull(() => connectionInfo, connectionInfo);
            Guard.NotNull(() => redisConnection, redisConnection);
            Guard.NotNull(() => redisNames, redisNames);
            Guard.NotNull(() => creationScope, creationScope);

            _redisConnection = redisConnection;
            _redisNames      = redisNames;
            ConnectionInfo   = connectionInfo;
            Scope            = creationScope;
        }
예제 #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueCreation" /> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information.</param>
        /// <param name="redisConnection">The redis connection.</param>
        /// <param name="redisNames">The redis names.</param>
        /// <param name="creationScope">The creation scope.</param>
        public RedisQueueCreation(IConnectionInformation connectionInfo,
            IRedisConnection redisConnection,
            RedisNames redisNames,
            ICreationScope creationScope)
        {
            Guard.NotNull(() => connectionInfo, connectionInfo);
            Guard.NotNull(() => redisConnection, redisConnection);
            Guard.NotNull(() => redisNames, redisNames);
            Guard.NotNull(() => creationScope, creationScope);

            _redisConnection = redisConnection;
            _redisNames = redisNames;
            ConnectionInfo = connectionInfo;
            Scope = creationScope;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueWorkSubRpc"/> class.
        /// </summary>
        /// <param name="connection">The connection.</param>
        /// <param name="redisNames">The redis names.</param>
        /// <param name="cancelWork">The cancel work.</param>
        /// <param name="messageId">The message identifier.</param>
        public RedisQueueWorkSubRpc(IRedisConnection connection,
                                    RedisNames redisNames,
                                    IQueueCancelWork cancelWork,
                                    IMessageId messageId)
        {
            Guard.NotNull(() => connection, connection);
            Guard.NotNull(() => redisNames, redisNames);
            Guard.NotNull(() => cancelWork, cancelWork);

            _connection = connection;
            _redisNames = redisNames;
            _cancelWork = cancelWork;
            _messageId  = messageId;

            _waitHandle = new ManualResetEventSlim(false);
            _waitHandle.Set();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueWorkSubRpc"/> class.
        /// </summary>
        /// <param name="connection">The connection.</param>
        /// <param name="redisNames">The redis names.</param>
        /// <param name="cancelWork">The cancel work.</param>
        /// <param name="messageId">The message identifier.</param>
        public RedisQueueWorkSubRpc(IRedisConnection connection,
            RedisNames redisNames,
            IQueueCancelWork cancelWork,
            IMessageId messageId)
        {
            Guard.NotNull(() => connection, connection);
            Guard.NotNull(() => redisNames, redisNames);
            Guard.NotNull(() => cancelWork, cancelWork);

            _connection = connection;
            _redisNames = redisNames;
            _cancelWork = cancelWork;
            _messageId = messageId;

            _waitHandle = new ManualResetEventSlim(false);
            _waitHandle.Set();
        }
예제 #12
0
        /// <summary>Initializes a new instance of the <see cref="RedisQueueCreation"/> class.</summary>
        /// <param name="connectionInfo">The connection information.</param>
        /// <param name="redisConnection">The redis connection.</param>
        /// <param name="redisNames">The redis names.</param>
        /// <param name="creationScope">The creation scope.</param>
        /// <param name="options">Options for queue configuration</param>
        public RedisQueueCreation(IConnectionInformation connectionInfo,
                                  IRedisConnection redisConnection,
                                  RedisNames redisNames,
                                  ICreationScope creationScope,
                                  RedisBaseTransportOptions options)
        {
            Guard.NotNull(() => connectionInfo, connectionInfo);
            Guard.NotNull(() => redisConnection, redisConnection);
            Guard.NotNull(() => redisNames, redisNames);
            Guard.NotNull(() => creationScope, creationScope);
            Guard.NotNull(() => options, options);

            _redisConnection = redisConnection;
            _redisNames      = redisNames;
            ConnectionInfo   = connectionInfo;
            Scope            = creationScope;
            _options         = options;
        }
예제 #13
0
 public VerifyErrorCounts(string queueName, string connectionString)
 {
     var connection = new BaseConnectionInformation(queueName, connectionString);
     _redisNames = new RedisNames(connection);
     _connection = new RedisConnection(connection);
 }