Merge pull request #130 from ben-krieger/schedule-task-non-block

Support HTTP Request and Cron Trigger in Single Worker
This commit is contained in:
syumai 2024-11-08 01:38:38 +09:00 committed by GitHub
commit 6e29c1e9e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,3 +55,7 @@ func ScheduleTask(task Task) {
ready() ready()
select {} 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 }