コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BackgroundJobClient"/> class
        /// with a specified job storage and job creation process.
        /// </summary>
        /// 
        /// <exception cref="ArgumentNullException"><paramref name="storage"/> argument is null.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="process"/> argument is null.</exception>
        public BackgroundJobClient(JobStorage storage, IJobCreationProcess process)
        {
            if (storage == null) throw new ArgumentNullException("storage");
            if (process == null) throw new ArgumentNullException("process");

            _connection = storage.GetConnection();
            _process = process;
        }
コード例 #2
0
        public RecurringJobManager([NotNull] JobStorage storage, [NotNull] IBackgroundJobClient client)
        {
            if (storage == null) throw new ArgumentNullException("storage");
            if (client == null) throw new ArgumentNullException("client");

            _storage = storage;
            _client = client;
        }
コード例 #3
0
        public BackgroundJobServer(BackgroundJobServerOptions options, JobStorage storage)
        {
            if (options == null) throw new ArgumentNullException("options");
            if (storage == null) throw new ArgumentNullException("storage");

            _options = options;
            _storage = storage;

            _serverId = String.Format("{0}:{1}", _options.ServerName.ToLowerInvariant(), Process.GetCurrentProcess().Id);

            // ReSharper disable once DoNotCallOverridableMethodsInConstructor
            _bootstrapSupervisor = GetBootstrapSupervisor();
        }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundJobClient"/> class
 /// with a specified job storage and job creation process.
 /// </summary>
 /// 
 /// <exception cref="ArgumentNullException"><paramref name="storage"/> argument is null.</exception>
 /// <exception cref="ArgumentNullException"><paramref name="process"/> argument is null.</exception>
 public BackgroundJobClient(
     JobStorage storage, 
     IStateMachineFactory stateMachineFactory, 
     IJobCreationProcess process)
 {
     if (storage == null) throw new ArgumentNullException("storage");
     if (stateMachineFactory == null) throw new ArgumentNullException("stateMachineFactory");
     if (process == null) throw new ArgumentNullException("process");
     
     _storage = storage;
     _stateMachineFactory = stateMachineFactory;
     _process = process;
 }
コード例 #5
0
 public BackgroundJobClient(JobStorage storage, IStateMachineFactory stateMachineFactory)
     : this(storage, stateMachineFactory, JobCreationProcess.Instance)
 {
 }
コード例 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundJobClient"/> class
 /// with a specified storage and the default global
 /// <see cref="JobCreationProcess"/> instance.
 /// </summary>
 public BackgroundJobClient(JobStorage storage)
     : this(storage, new StateMachineFactory(storage))
 {
 }
コード例 #7
0
 public void UseStorage(JobStorage storage)
 {
     Storage = storage;
 }
コード例 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundJobClient"/> class
 /// with a specified storage and the default global
 /// <see cref="JobCreationProcess"/> instance.
 /// </summary>
 public BackgroundJobClient(JobStorage storage)
     : this(storage, JobCreationProcess.Instance)
 {
 }
コード例 #9
0
 public BackgroundJobClient(JobStorage storage, IStateMachineFactory stateMachineFactory)
     : this(storage, stateMachineFactory, JobCreationProcess.Instance)
 {
 }
コード例 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundJobClient"/> class
 /// with a specified storage and the default global
 /// <see cref="JobCreationProcess"/> instance.
 /// </summary>
 public BackgroundJobClient(JobStorage storage)
     : this(storage, new StateMachineFactory(storage))
 {
 }