{"id":15890341,"url":"https://github.com/dimfeld/effectum","last_synced_at":"2025-07-10T10:32:50.156Z","repository":{"id":62812747,"uuid":"544238154","full_name":"dimfeld/effectum","owner":"dimfeld","description":"Job Queue based on SQLite","archived":false,"fork":false,"pushed_at":"2024-07-23T18:39:41.000Z","size":197,"stargazers_count":32,"open_issues_count":2,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T00:47:07.638Z","etag":null,"topics":["queue","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/effectum","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dimfeld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-02T01:44:25.000Z","updated_at":"2025-04-10T17:16:48.000Z","dependencies_parsed_at":"2024-07-23T21:55:04.697Z","dependency_job_id":null,"html_url":"https://github.com/dimfeld/effectum","commit_stats":{"total_commits":93,"total_committers":2,"mean_commits":46.5,"dds":"0.010752688172043001","last_synced_commit":"eb1867bf82f134b9d6e23ebac424c2017a7fef47"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimfeld%2Feffectum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimfeld%2Feffectum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimfeld%2Feffectum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimfeld%2Feffectum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimfeld","download_url":"https://codeload.github.com/dimfeld/effectum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248894938,"owners_count":21179152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["queue","rust"],"created_at":"2024-10-06T07:05:17.394Z","updated_at":"2025-04-14T14:11:57.399Z","avatar_url":"https://github.com/dimfeld.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Effectum\n\nA Rust job queue library, based on SQLite so it doesn't depend on any other services.\n\nCurrently this is just a library embeddable into Rust applications, but future goals include bindings into other languages\nand the ability to run as a standalone server, accessible by HTTP and gRPC. This will be designed so that a product can\nstart with the embedded version to use minimal infrastructure, and then move to the server version with minimal changes when\nthe time comes to scale out.\n\n```rust\nuse effectum::{Error, Job, JobState, JobRunner, RunningJob, Queue, Worker};\n\n#[derive(Debug)]\npub struct JobContext {\n   // database pool or other things here\n}\n\n#[derive(Serialize, Deserialize)]\nstruct RemindMePayload {\n  email: String,\n  message: String,\n}\n\nasync fn remind_me_job(job: RunningJob, context: Arc\u003cJobContext\u003e) -\u003e Result\u003c(), Error\u003e {\n    let payload: RemindMePayload = job.json_payload()?;\n    // do something with the job\n    Ok(())\n}\n\n#[tokio::main(flavor = \"current_thread\")]\nasync fn main() -\u003e Result\u003c(), Error\u003e {\n  // Create a queue\n  let queue = Queue::new(\u0026PathBuf::from(\"effectum.db\")).await?;\n\n  // Define a type job for the queue.\n  let a_job = JobRunner::builder(\"remind_me\", remind_me_job).build();\n\n  let context = Arc::new(JobContext{\n    // database pool or other things here\n  });\n\n  // Create a worker to run jobs.\n  let worker = Worker::builder(\u0026queue, context)\n    .max_concurrency(10)\n    .jobs([a_job])\n    .build();\n\n  // Submit a job to the queue.\n  let job_id = Job::builder(\"remind_me\")\n    .run_at(time::OffsetDateTime::now_utc() + std::time::Duration::from_secs(3600))\n    .json_payload(\u0026RemindMePayload {\n        email: \"me@example.com\".to_string(),\n        message: \"Time to go!\".to_string()\n    })?\n    .add_to(\u0026queue)\n    .await?;\n\n  // See what's happening with the job.\n  let status = queue.get_job_status(job_id).await?;\n  assert_eq!(status.state, JobState::Pending);\n\n  // Do other stuff...\n\n  Ok(())\n}\n```\n\n[Changelog](https://github.com/dimfeld/effectum/blob/master/effectum/CHANGELOG.md)\n\n[Full Development Notes](https://imfeld.dev/notes/projects_effectum)\n\n# Roadmap\n\n## Released\n\n- Multiple job types\n- Jobs can be added with higher priority to \"skip the line\"\n- Workers can run multiple jobs concurrently\n- Schedule jobs in the future\n- Automatically retry failed jobs, with exponential backoff\n- Checkpoints to allow smart resumption of a job if it fails midway through.\n- Immediately schedule a retry for jobs that were running when the process restarts unexpectedly\n- Cancel or modify pending jobs\n- Support for recurring jobs\n\n## Soon\n\n- Optional sweeper to prevent \"done\" job data from building up indefinitely\n\n## Later\n\n- Node.js bindings\n- Run as a standalone server over gRPC\n- Helpers for communicating with the queue via the outbox pattern.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimfeld%2Feffectum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimfeld%2Feffectum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimfeld%2Feffectum/lists"}