public static TaskQueue Redis(string redisConnectionString, string queueName = null)
        {
            var config  = TaskQueueConfiguration.Default();
            var backend = new RedisTaskQueueBackend(redisConnectionString,
                                                    queueName ?? config.QueueName,
                                                    config.BackupQueueName);

            var taskQueue = new TaskQueue(backend, config);

            return(taskQueue);
        }
Example #2
0
        public TaskQueue(ITaskQueueBackend backend, TaskQueueConfiguration config = null)
        {
            Backend = backend;
            Config  = config ?? new TaskQueueConfiguration();

            // Usage of the Task Queue in Parallel Threads, requires the thread pool size to be increased.
            // https://stackexchange.github.io/StackExchange.Redis/Timeouts#are-you-seeing-high-number-of-busyio-or-busyworker-threads-in-the-timeout-exception
            if (config.ThreadSafe)
            {
                ThreadPool.SetMinThreads(200, 200);
            }
        }
Example #3
0
        public TaskQueue(ITaskQueueBackend backend, TaskQueueConfiguration config = null)
        {
            Backend = backend;
            Config  = config ?? TaskQueueConfiguration.Default();

            // Usage of the Task Queue in Parallel Threads, requires the thread pool size to be increased.
            // https://stackexchange.github.io/StackExchange.Redis/Timeouts#are-you-seeing-high-number-of-busyio-or-busyworker-threads-in-the-timeout-exception
            // REVIEW: This should no longer be necessary now that we are using the redis async api.
            if (Config.ThreadSafe)
            {
                ThreadPool.SetMinThreads(200, 200);
            }
        }
Example #4
0
        public static TaskQueue Redis(string redisConnectionString, string queueName = null)
        {
            var config = TaskQueueConfiguration.Default();

            if (queueName != null)
            {
                config.QueueName = queueName;
            }

            var backend = new RedisBackend(redisConnectionString);

            var taskQueue = new TaskQueue(backend, config);

            return(taskQueue);
        }