From 7f055bcba21ccee051b83240d55250b64b0da286 Mon Sep 17 00:00:00 2001 From: Deluan Date: Wed, 24 Dec 2025 10:10:01 -0500 Subject: [PATCH] docs(scheduler): clarify SchedulerCallback requirement for scheduling functions Signed-off-by: Deluan --- plugins/host/go/nd_host_scheduler.go | 2 ++ plugins/host/scheduler.go | 2 ++ plugins/testdata/fake-scheduler/nd_host_scheduler.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/plugins/host/go/nd_host_scheduler.go b/plugins/host/go/nd_host_scheduler.go index 27bb3d530..1aef70972 100644 --- a/plugins/host/go/nd_host_scheduler.go +++ b/plugins/host/go/nd_host_scheduler.go @@ -43,6 +43,7 @@ type SchedulerScheduleRecurringResponse struct { // SchedulerScheduleOneTime calls the scheduler_scheduleonetime host function. // ScheduleOneTime schedules a one-time event to be triggered after the specified delay. +// Plugins that use this function must also implement the SchedulerCallback capability // // Parameters: // - delaySeconds: Number of seconds to wait before triggering the event @@ -74,6 +75,7 @@ func SchedulerScheduleOneTime(delaySeconds int32, payload string, scheduleID str // SchedulerScheduleRecurring calls the scheduler_schedulerecurring host function. // ScheduleRecurring schedules a recurring event using a cron expression. +// Plugins that use this function must also implement the SchedulerCallback capability // // Parameters: // - cronExpression: Standard cron format expression (e.g., "0 0 * * *" for daily at midnight) diff --git a/plugins/host/scheduler.go b/plugins/host/scheduler.go index 114489722..9a1fd018f 100644 --- a/plugins/host/scheduler.go +++ b/plugins/host/scheduler.go @@ -10,6 +10,7 @@ import "context" //nd:hostservice name=Scheduler permission=scheduler type SchedulerService interface { // ScheduleOneTime schedules a one-time event to be triggered after the specified delay. + // Plugins that use this function must also implement the SchedulerCallback capability // // Parameters: // - delaySeconds: Number of seconds to wait before triggering the event @@ -21,6 +22,7 @@ type SchedulerService interface { ScheduleOneTime(ctx context.Context, delaySeconds int32, payload string, scheduleID string) (newScheduleID string, err error) // ScheduleRecurring schedules a recurring event using a cron expression. + // Plugins that use this function must also implement the SchedulerCallback capability // // Parameters: // - cronExpression: Standard cron format expression (e.g., "0 0 * * *" for daily at midnight) diff --git a/plugins/testdata/fake-scheduler/nd_host_scheduler.go b/plugins/testdata/fake-scheduler/nd_host_scheduler.go index 27bb3d530..1aef70972 100644 --- a/plugins/testdata/fake-scheduler/nd_host_scheduler.go +++ b/plugins/testdata/fake-scheduler/nd_host_scheduler.go @@ -43,6 +43,7 @@ type SchedulerScheduleRecurringResponse struct { // SchedulerScheduleOneTime calls the scheduler_scheduleonetime host function. // ScheduleOneTime schedules a one-time event to be triggered after the specified delay. +// Plugins that use this function must also implement the SchedulerCallback capability // // Parameters: // - delaySeconds: Number of seconds to wait before triggering the event @@ -74,6 +75,7 @@ func SchedulerScheduleOneTime(delaySeconds int32, payload string, scheduleID str // SchedulerScheduleRecurring calls the scheduler_schedulerecurring host function. // ScheduleRecurring schedules a recurring event using a cron expression. +// Plugins that use this function must also implement the SchedulerCallback capability // // Parameters: // - cronExpression: Standard cron format expression (e.g., "0 0 * * *" for daily at midnight)