Skip to content

Instantly share code, notes, and snippets.



Created Mar 18, 2020
What would you like to do?
pub struct JobContext {
pub db_pool: DBPool,
pub redis_pool: RedisPool,
pub trait Job {
fn run(&self, ctx: &JobContext) -> JobResult;
fn get_interval(&self) -> Duration;
fn get_name(&self) -> &'static str;
fn get_sync_key(&self) -> &'static str;
fn box_clone(&self) -> BoxedJob;
impl Clone for Box<dyn Job> {
fn clone(&self) -> Box<dyn Job> {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.