예제 #1
0
 public TaskReSchedulerService(
     ITaskSchedulerRepository taskSchedulerRepository,
     ILogger <TaskReSchedulerService> logger)
 {
     this._taskSchedulerRepository = taskSchedulerRepository
                                     ?? throw new ArgumentNullException(nameof(taskSchedulerRepository));
     this._logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DelayedScheduler"/> class.
 /// </summary>
 /// <param name="taskSchedulerRepository">
 /// The task scheduler repository.
 /// </param>
 /// <param name="scheduledRulePublisher">
 /// The scheduled rule publisher.
 /// </param>
 /// <param name="distributedScheduledRulePublisher">
 /// The distributed scheduled rule publisher.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 public DelayedScheduler(
     ITaskSchedulerRepository taskSchedulerRepository,
     IQueueScheduledRulePublisher scheduledRulePublisher,
     IQueueDelayedRuleDistributedPublisher distributedScheduledRulePublisher,
     ILogger <DelayedScheduler> logger)
 {
     this.taskSchedulerRepository =
         taskSchedulerRepository ?? throw new ArgumentNullException(nameof(taskSchedulerRepository));
     this.scheduledRulePublisher =
         scheduledRulePublisher ?? throw new ArgumentNullException(nameof(scheduledRulePublisher));
     this.distributedScheduledRulePublisher =
         distributedScheduledRulePublisher ?? throw new ArgumentNullException(nameof(distributedScheduledRulePublisher));
     this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
예제 #3
0
        public async Task <ResponseSend> SendAsync(AccountSend accountInfo)
        {
            ITaskSchedulerRepository repository = Provider.TaskService.TaskSchedulerRepository;
            var contacts = await repository.GetContacts(accountInfo);

            await LoadContactsManager(contacts.ToList());

            foreach (var contactManagerItem in _contactsManager)
            {
                var messages = await repository.GetMessagesContact(contactManagerItem.ContactInfo);

                foreach (var message_item in messages)
                {
                    await PreSend(accountInfo, contactManagerItem.ContactInfo, message_item);

                    await contactManagerItem.SendMessage(message_item);
                    await PostSend(accountInfo, contactManagerItem.ContactInfo, message_item);
                }
            }
            return(new ResponseSend {
                IsError = false
            });
        }
예제 #4
0
 public MockHttpSender(IBaladorContext context, ITaskSchedulerRepository taskSchedulerRepository) : base(context, taskSchedulerRepository)
 {
 }
예제 #5
0
 public TaskSchedulerManager(ITaskSchedulerRepository taskSchedulerRepository)
 {
     _taskSchedulerRepository = taskSchedulerRepository;
 }
예제 #6
0
 public TaskService(IUnitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
     _taskSchedulerRepository = new TaskSchedulerRepository(_unitOfWork);
     _messageRepository       = new MessageRepository(_unitOfWork);
 }