예제 #1
0
        public ServerWatchdog(JobStorage storage, ServerWatchdogOptions options)
        {
            if (storage == null) throw new ArgumentNullException("storage");
            if (options == null) throw new ArgumentNullException("options");

            _storage = storage;
            _options = options;
        }
        public BackgroundJobServerOptions()
        {
            WorkerCount = Math.Min(Environment.ProcessorCount * 5, MaxDefaultWorkerCount);
            ServerName = Environment.MachineName;
            Queues = new[] { EnqueuedState.DefaultQueue };
            ShutdownTimeout = TimeSpan.FromSeconds(15);
            SchedulePollingInterval = TimeSpan.FromSeconds(15);

            ServerWatchdogOptions = new ServerWatchdogOptions();
        }
예제 #3
0
        public ServerWatchdogFacts()
        {
            _storage = new Mock<JobStorage>();
            _connection = new Mock<IStorageConnection>();
            _options = new ServerWatchdogOptions
            {
                CheckInterval = Timeout.InfiniteTimeSpan // To check that it exits by cancellation token
            };
			_cts = new CancellationTokenSource();
			_cts.Cancel();

            _storage.Setup(x => x.GetConnection()).Returns(_connection.Object);
        }
예제 #4
0
        public ServerWatchdog(JobStorage storage, ServerWatchdogOptions options)
        {
            if (storage == null)
            {
                throw new ArgumentNullException("storage");
            }
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            _storage = storage;
            _options = options;
        }