示例#1
0
        public FetchedJobsWatcher(
            JobStorage storage,
            FetchedJobsWatcherOptions options)
        {
            if (storage == null) throw new ArgumentNullException("storage");
            if (options == null) throw new ArgumentNullException("options");

            _storage = storage;
            _options = options;
        }
示例#2
0
 /// <summary>
 /// 初始化一个<see cref="FetchedJobsWatcher"/>类型的实例
 /// </summary>
 /// <param name="storage">Redis存储</param>
 /// <param name="invisibilityTimeout">隐形超时时间</param>
 /// <param name="options">拉取作业观察者选项配置</param>
 public FetchedJobsWatcher(RedisStorage storage, TimeSpan invisibilityTimeout, FetchedJobsWatcherOptions options)
 {
     if (invisibilityTimeout.Ticks <= 0)
     {
         throw new ArgumentOutOfRangeException(nameof(invisibilityTimeout), "Invisibility timeout duration should be positive.");
     }
     _storage             = storage ?? throw new ArgumentNullException(nameof(storage));
     _options             = options ?? throw new ArgumentNullException(nameof(options));
     _invisibilityTimeout = invisibilityTimeout;
 }
        public FetchedJobsWatcher(
            RedisStorage storage,
            TimeSpan invisibilityTimeout,
            FetchedJobsWatcherOptions options)
        {
            if (storage == null) throw new ArgumentNullException("storage");
            if (options == null) throw new ArgumentNullException("options");
            if (invisibilityTimeout.Ticks <= 0)
            {
                throw new ArgumentOutOfRangeException("invisibilityTimeout", "Invisibility timeout duration should be positive.");
            }

            _storage = storage;
            _invisibilityTimeout = invisibilityTimeout;
            _options = options;
        }
示例#4
0
        public FetchedJobsWatcher(
            JobStorage storage,
            FetchedJobsWatcherOptions options)
        {
            if (storage == null)
            {
                throw new ArgumentNullException("storage");
            }
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

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

            _storage             = storage;
            _invisibilityTimeout = invisibilityTimeout;
            _options             = options;
        }