public IActionResult FireAndForget() { var jobId = BackgroundJob.Enqueue(() => Console.WriteLine("Enqueue")); var response = new CreateTaskResponseModel(jobId); return(Ok(response)); }
public IActionResult Delayed() { var jobId = BackgroundJob.Schedule(() => Console.WriteLine("Delayed"), TimeSpan.FromMinutes(1)); var response = new CreateTaskResponseModel(jobId); return(Ok(response)); }