Crate runat

Crate runat 

Source
Expand description

§RunAt - Distributed Job Scheduler

A distributed job scheduler for Rust

§Example

use runat::{Job, JobScheduler, JobContext};

#[derive(Job)]
struct EmailJob {
    to: String,
    subject: String,
    body: String,
}

#[async_trait::async_trait]
impl JobHandler for EmailJob {
    async fn handle(&self, ctx: JobContext) -> anyhow::Result<()> {
        // Send email logic here
        Ok(())
    }
}

Re-exports§

pub use datastore::Datastore;
pub use error::Error;
pub use error::JobResult;
pub use job::BackgroundJob;
pub use job::Executable;
pub use job::Job;
pub use job::JobStatus;
pub use job::JobSchedule;
pub use job::Retry;
pub use job::RetryStrategy;
pub use queue::JobHandler;
pub use queue::JobQueue;
pub use queue::JobQueueConfig;
pub use queue::JobRegistry;
pub use queue::JobWorker;
pub use datastore::PostgresDatastore;

Modules§

datastore
error
job
queue

Derive Macros§

BackgroundJob