static async Task Main(string[] args) { IJobService myJobService1 = JobManager.Scheduler() .ToRunOnceIn(3) .Seconds() .AtStartTime() .BuildJobService <MyJobGreen>(); IJobService myJobService2 = JobManager.Scheduler() .ToRunOnceIn(1) .Seconds() .AtTheEndOfDay() .BuildJobService <MyJobRed>(); IAsyncJobService asyncJobService = JobManager.Scheduler() .ToRunOnceIn(1) .Seconds() .AtStartTime() .BuildAsyncJobService <MyAsyncJob>(); var cancellationTokenSource = new CancellationTokenSource(); var token = cancellationTokenSource.Token; myJobService1.Start(token); myJobService2.Start(token); await asyncJobService.StartAsync(token); Thread.Sleep(15000); cancellationTokenSource.Cancel(); cancellationTokenSource.Dispose(); Console.ReadLine(); }
public MakePaymentConsumer( IAsyncJobService service, IBankProcessor processor, IPaymentRepository repository) : base(service) { _processor = processor; _repository = repository; }
public Handler(IAsyncJobService bus) => _bus = bus;
protected CommandConsumer(IAsyncJobService service) => _service = service;
public Handler(IAsyncJobService service, IMapper mapper) { _service = service; _mapper = mapper; }