示例#1
0
        public async Task SendAfterDelay(ActorMessageContext message, TimeSpan delay, bool cancelExisting = true, CancellationToken token = default)
        {
            var uid = message.GetMessageUid();

            if (cancelExisting)
            {
                await _scheduler.CancelJob(uid);
            }

            await _scheduler.DelayExecution <ActorMessageJob, ActorMessageContext>(delay, message, uid, token);
        }
示例#2
0
        public async Task SendDailyAt(ActorMessageContext message, TimeSpan time, CancellationToken token = default, string calendar = default)
        {
            var uid = message.GetMessageUid();

            await _scheduler.ScheduleDailyTimeInterval <ActorMessageJob, ActorMessageContext>(time, message, uid, token);
        }
示例#3
0
        public async Task SendAtTime(ActorMessageContext message, DateTimeOffset time, CancellationToken token = default)
        {
            var uid = message.GetMessageUid();

            await _scheduler.DelayExecution <ActorMessageJob, ActorMessageContext>(time, message, uid, token);
        }
示例#4
0
        public Task SendWithCronRepeat(ActorMessageContext message, string cronExpression, CancellationToken token = default, string calendar = default)
        {
            var uid = message.GetMessageUid();

            return(_scheduler.ScheduleCron <ActorMessageJob, ActorMessageContext>(cronExpression, message, uid, token, calendar));
        }
示例#5
0
 public Task SendWithSimpleRepeat(ActorMessageContext message, TimeSpan interval, CancellationToken token = default)
 {
     return(_scheduler.ScheduleInterval <ActorMessageJob, ActorMessageContext>(interval, message, message.GetMessageUid(), token));
 }