public FetchedJob(AzureDocumentDbStorage storage, Entities.Queue data)
 {
     this.storage = storage;
     Id           = data.Id;
     JobId        = data.JobId;
     Queue        = data.Name;
     SelfLink     = data.SelfLink;
 }
        /// <summary>
        /// Enables to attache AzureDocumentDb to Hangfire
        /// </summary>
        /// <param name="configuration">The IGlobalConfiguration object</param>
        /// <param name="url">The url string to AzureDocumentDb Database</param>
        /// <param name="authSecret">The secret key for the AzureDocumentDb Database</param>
        /// <param name="database">The name of the database to connect with</param>
        /// <returns></returns>
        public static IGlobalConfiguration <AzureDocumentDbStorage> UseAzureDocumentDbStorage(this IGlobalConfiguration configuration, string url, string authSecret, string database)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }
            if (string.IsNullOrEmpty(url))
            {
                throw new ArgumentNullException(nameof(url));
            }
            if (string.IsNullOrEmpty(authSecret))
            {
                throw new ArgumentNullException(nameof(authSecret));
            }

            AzureDocumentDbStorage storage = new AzureDocumentDbStorage(url, authSecret, database);

            return(configuration.UseStorage(storage));
        }
Example #3
0
 public JobQueueProvider(AzureDocumentDbStorage storage)
 {
     queue           = new JobQueue(storage);
     monitoringQueue = new JobQueueMonitoringApi(storage);
 }
Example #4
0
 public JobQueueMonitoringApi(AzureDocumentDbStorage storage)
 {
     this.storage = storage;
     queues       = storage.Options.Queues;
 }
 public JobQueue(AzureDocumentDbStorage storage)
 {
     this.storage  = storage;
     checkInterval = storage.Options.QueuePollInterval;
 }