Skip to content

Commit

Permalink
Add cron.ScheduleTaskNonBlock for use with workers.Serve
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-krieger committed Nov 7, 2024
1 parent bdd54f0 commit 0db110c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cloudflare/cron/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ func ScheduleTask(task Task) {
ready()
select {}
}

// ScheduleTaskNonBlock sets the Task to be executed but does not signal readiness or block
// indefinitely. The non-blocking form is meant to be used in conjunction with [workers.Serve].
func ScheduleTaskNonBlock(task Task) { scheduledTask = task }

0 comments on commit 0db110c

Please sign in to comment.