public RedisConnection(IDatabase redis, RedisStorageInternals StorageInternals)
 {
     Redis  = redis;
     Sub    = StorageInternals.Sub;
     LockID = StorageInternals.StorageLockID;
     Prefix = StorageInternals.Prefix;
 }
 public RedisConnection(IDatabase redis, RedisStorageInternals StorageInternals)
 {
     Redis = redis;
     Sub = StorageInternals.Sub;
     LockID = StorageInternals.StorageLockID;
     Prefix = StorageInternals.Prefix;
 }
        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 RedisWriteOnlyTransaction(ITransaction transaction, RedisSubscribe sub, string prefix)
        {
            if (transaction == null) throw new ArgumentNullException("transaction");

            Transaction = transaction;
            _sub = sub;
            Prefix = prefix;
        }
Example #5
0
        public RedisWriteOnlyTransaction(ITransaction transaction, RedisSubscribe sub, string prefix)
        {
            if (transaction == null)
            {
                throw new ArgumentNullException("transaction");
            }

            Transaction = transaction;
            _sub        = sub;
            Prefix      = prefix;
        }
        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);
        }
Example #7
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 RedisStorageInternals(string Prefix, string StorageLockID, RedisSubscribe Sub)
 {
     this.StorageLockID = StorageLockID;
     this.Prefix = Prefix;
     this.Sub = Sub;
 }
Example #9
0
 public RedisStorageInternals(string Prefix, string StorageLockID, RedisSubscribe Sub)
 {
     this.StorageLockID = StorageLockID;
     this.Prefix        = Prefix;
     this.Sub           = Sub;
 }
        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);


        }