Scheduling
Register and run scheduled jobs through module lifecycle hooks.
Feature activation
Section titled “Feature activation”nestforge = { version = "1", features = ["schedule"] }Core types
Section titled “Core types”Scheduling support is built around:
ScheduleRegistryScheduleRegistryBuilderstart_schedulesshutdown_schedules
Registration pattern
Section titled “Registration pattern”The standard approach is to register a ScheduleRegistry provider and start it during
application bootstrap:
#[module( providers = [build_schedule_registry()?], on_application_bootstrap = [nestforge::start_schedules], on_application_shutdown = [nestforge::shutdown_schedules])]pub struct AppModule;Job types
Section titled “Job types”The current registry supports:
- repeated jobs with
every(...) - one-shot delayed jobs with
after(...) - named variants with
every_named(...)andafter_named(...)
Practical use
Section titled “Practical use”Scheduling belongs in modules when the jobs are part of application behavior, not as hidden global threads. This keeps lifecycle and shutdown behavior explicit.