public RedisStorage(ConfigurationOptions Options, int db, string prefix)
        {
            if (Options == null)
            {
                throw new ArgumentNullException("Options");
            }

            var HangfireOptions = new RedisStorageOptions()
            {
                Prefix = prefix
            };

            Db = db;
            Options.AbortOnConnectFail = false;
            Options.ClientName         = ClientName;
            ServerPool = ConnectionMultiplexer.Connect(Options);

            var Sub    = new RedisSubscribe(ServerPool.GetSubscriber(), prefix);
            var LockID = Guid.NewGuid().ToString();

            StorageInternals = new RedisStorageInternals(prefix, LockID, Sub);



            FetchedJobsOptions = new FetchedJobsWatcherOptions(HangfireOptions);
        }
        public FetchedJobsWatcher(JobStorage storage, FetchedJobsWatcherOptions options)
        {
            if (storage == null) throw new ArgumentNullException("storage");
            if (options == null) throw new ArgumentNullException("options");
            if (options.InvisibilityTimeout.Ticks <= 0)
            {
                throw new ArgumentOutOfRangeException("invisibilityTimeout", "Invisibility timeout duration should be positive.");
            }

            _storage = storage;
            _options = options;
        }
        public FetchedJobsWatcher(JobStorage storage, FetchedJobsWatcherOptions options)
        {
            if (storage == null)
            {
                throw new ArgumentNullException("storage");
            }
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }
            if (options.InvisibilityTimeout.Ticks <= 0)
            {
                throw new ArgumentOutOfRangeException("invisibilityTimeout", "Invisibility timeout duration should be positive.");
            }

            _storage = storage;
            _options = options;
        }
        public RedisStorage(ConfigurationOptions Options, int db, string prefix)
        {
            if (Options == null) throw new ArgumentNullException("Options");

            var HangfireOptions = new RedisStorageOptions()
            {
                Prefix = prefix
            };

            Db = db;
            Options.AbortOnConnectFail = false;
            Options.ClientName = ClientName;
            ServerPool = ConnectionMultiplexer.Connect(Options);

            var Sub = new RedisSubscribe(ServerPool.GetSubscriber(), prefix);
            var LockID = Guid.NewGuid().ToString();
            StorageInternals = new RedisStorageInternals(prefix, LockID, Sub);

            FetchedJobsOptions = new FetchedJobsWatcherOptions(HangfireOptions);
        }
예제 #5
0
        public RedisStorage(ConfigurationOptions RedisOptions, RedisStorageOptions HangfireOptions)
        {
            if (RedisOptions == null)
            {
                throw new ArgumentNullException("RedisOptions");
            }
            if (HangfireOptions == null)
            {
                throw new ArgumentNullException("HangfireOptions");
            }

            Db = HangfireOptions.Db;
            RedisOptions.AbortOnConnectFail = false;
            RedisOptions.ClientName         = ClientName;
            ServerPool = ConnectionMultiplexer.Connect(RedisOptions);

            var Sub    = new RedisSubscribe(ServerPool.GetSubscriber(), HangfireOptions.Prefix);
            var LockID = Guid.NewGuid().ToString();

            StorageInternals   = new RedisStorageInternals(HangfireOptions.Prefix, LockID, Sub);
            FetchedJobsOptions = new FetchedJobsWatcherOptions(HangfireOptions);
        }
        public RedisStorage(ConfigurationOptions RedisOptions, RedisStorageOptions HangfireOptions)
        {
            if (RedisOptions == null) throw new ArgumentNullException("RedisOptions");
            if (HangfireOptions == null) throw new ArgumentNullException("HangfireOptions");

            Db = HangfireOptions.Db;
            RedisOptions.AbortOnConnectFail = false;
            RedisOptions.ClientName = ClientName;
            ServerPool = ConnectionMultiplexer.Connect(RedisOptions);

            var Sub = new RedisSubscribe(ServerPool.GetSubscriber(), HangfireOptions.Prefix);
            var LockID = Guid.NewGuid().ToString();
            StorageInternals = new RedisStorageInternals(HangfireOptions.Prefix, LockID, Sub);
            FetchedJobsOptions = new FetchedJobsWatcherOptions(HangfireOptions);


        }