Example #1
0
        /// <summary>
        /// Enqueues the job for execution using the given <see cref="IJobStore"/>.
        /// </summary>
        /// <param name="store">The job store to use when queueing the job.</param>
        /// <returns>The job record that was persisted.</returns>
        public virtual JobRecord Enqueue(IJobStore store)
        {
            if (store == null)
            {
                throw new ArgumentNullException("store", "store cannot be null.");
            }

            JobRecord record = this.CreateRecord();
            store.SaveJob(record);

            return record;
        }