Skip to main content

Module scheduling

Module scheduling 

Source
Expand description

Scheduling — the tasks and commands that need more than the scheduler crate depends on.

rainier-scheduler knows about the container and the cache and nothing else, which is what keeps it usable without a queue or a console. The two things people actually schedule — a queued job and a console command — are adapters, and they live here because this is the crate that has both.

ⓘ
// src/routes/console.rs
pub fn schedule(schedule: &mut Schedule) {
    schedule.job(PruneSessions).daily_at("03:00").without_overlapping(HALF_HOUR);
    schedule.command("app:seed").weekly_on(1, "04:00").on_one_server();
    schedule.call("heartbeat", |_| Box::pin(async { Ok(()) })).every_five_minutes();
}

Structs§

CommandTask
A Task that runs a console command.
JobTask
A Task that dispatches a queued job.
ScheduleListCommand
schedule:list — what is scheduled, and when it next runs.
ScheduleRunCommand
schedule:run — run whatever is due this minute, then exit.
ScheduleWorkCommand
schedule:work — the same thing in a loop, for a container.

Traits§

ScheduleExt
job and command, on top of Schedule.

Functions§

assert_locks_are_shared
Refuse to run a schedule whose locking is decoration.
warn_if_locks_are_not_shared
Say so at boot, in any environment, and carry on.