Exemplo n.º 1
0
        /// <summary>
        /// BaseQueueTask constructor
        /// </summary>
        /// <param name="changedQueueManager">
        /// for use with testing
        /// </param>
        /// <param name="queueCode">queue code for this base queue task</param>
        protected BaseQueueTask(QueueCodeType queueCode, QueueManager changedQueueManager = null)
        {
            // DbDrivenQueueProcessor can be swap out for another type of processor
            queueManager = changedQueueManager ?? new QueueManager(new DbDrivenQueueProcessor());
            
            // Reset queue items on initialize
            queueManager.ResetStaleQueueItems();

            // specific queue type that task will be handling
            queueCodeType = queueCode;

            // default retry settings if none specified
            if (RetryIntervalSettings == null)
            {
                RetryIntervalSettings = new ServiceTaskRetryInterval
                                            {
                                                Interval = DEFAULT_INTERVAL,
                                                RetryCount = DEFAULT_RETRY_COUNT
                                            };
            }

            retryQueueItems = new ConcurrentDictionary<int, IQueueItem>();
            retriesLeft = new ConcurrentDictionary<int, int>();
            nextRetryTime = new ConcurrentDictionary<int, DateTime>();
        }
Exemplo n.º 2
0
 public PushNotificationTask(QueueManager changedQueueManager = null) : base(QueueCodeType.PushNotification, changedQueueManager)
 {
     pushNotificationManager = new PushNotificationManager();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Constructor to initialize required services
 /// </summary>
 /// <param name="testQueueManager">for testing purposes</param>
 public AigBusinessChangeTask(QueueManager testQueueManager = null) : base(QueueCodeType.PushIntegratonBusiness, testQueueManager)
 {
     providerSubscriberOptInService = new ProviderAndSubscriberOptinService();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Constructor to initialize required services
 /// </summary>
 /// <param name="testQueueManager">For testing purposes</param>
 public AigInventoryChangeTask(QueueManager testQueueManager = null)
     : base(QueueCodeType.PushIntegrationInventory, testQueueManager)
 {
     providerSubscriberOptInService = new ProviderAndSubscriberOptinService();
 }