{"id":44538403,"url":"https://github.com/gistia/aide-de-camp-mongodb","last_synced_at":"2026-02-13T18:53:42.759Z","repository":{"id":184906609,"uuid":"672638104","full_name":"gistia/aide-de-camp-mongodb","owner":"gistia","description":"A MongoDB backed implementation of the job Queue for aide-de-camp.","archived":false,"fork":false,"pushed_at":"2025-01-28T18:49:51.000Z","size":61,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-28T19:38:23.812Z","etag":null,"topics":["database","document","job","mongodb","queue","rust","scheduler"],"latest_commit_sha":null,"homepage":"","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/gistia.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":"2023-07-30T18:54:37.000Z","updated_at":"2023-12-03T23:24:46.000Z","dependencies_parsed_at":"2025-01-28T19:32:02.210Z","dependency_job_id":"a1792305-4bf8-4a6e-9afb-2650e3c028f9","html_url":"https://github.com/gistia/aide-de-camp-mongodb","commit_stats":null,"previous_names":["gistia/aide-de-camp-mongodb"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gistia/aide-de-camp-mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gistia%2Faide-de-camp-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gistia%2Faide-de-camp-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gistia%2Faide-de-camp-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gistia%2Faide-de-camp-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gistia","download_url":"https://codeload.github.com/gistia/aide-de-camp-mongodb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gistia%2Faide-de-camp-mongodb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29414285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["database","document","job","mongodb","queue","rust","scheduler"],"created_at":"2026-02-13T18:53:42.619Z","updated_at":"2026-02-13T18:53:42.753Z","avatar_url":"https://github.com/gistia.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aide-de-camp-mongodb\n\n[![crates.io](https://img.shields.io/crates/v/aide-de-camp-mongodb.svg)](https://crates.io/crates/aide-de-camp-mongodb)\n[![docs.rs](https://img.shields.io/docsrs/aide-de-camp-mongodb)](https://docs.rs/crate/aide-de-camp-mongodb)\n[![CI Tests](https://github.com/gistia/aide-de-camp-mongodb/actions/workflows/ci.yml/badge.svg)](https://github.com/gistia/aide-de-camp-mongodb/actions/workflows/ci.yml)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA MongoDB backed implementation of the job Queue for [aide-de-camp](https://github.com/ZeroAssumptions/aide-de-camp).\n\n## Example\n\n```rust\nuse aide_de_camp::prelude::{\n    CancellationToken, Duration, JobProcessor, JobRunner, Queue, RunnerOptions, RunnerRouter, Xid,\n};\nuse aide_de_camp_mongodb::MongoDbQueue;\nuse async_trait::async_trait;\n\nstruct MyJob;\n\n#[async_trait]\nimpl JobProcessor for MyJob {\n    type Payload = Vec\u003cu32\u003e;\n    type Error = anyhow::Error;\n\n    async fn handle(\n        \u0026self,\n        _jid: Xid,\n        payload: Self::Payload,\n        _cancellation_token: CancellationToken,\n    ) -\u003e Result\u003c(), Self::Error\u003e {\n        println!(\"payload: {:?}\", payload);\n        Ok(())\n    }\n\n    fn name() -\u003e \u0026'static str {\n        \"my_job\"\n    }\n}\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let queue = MongoDbQueue::new(\"mongodb://localhost:27017/queues\", None).await?;\n\n    // Add job the queue to run next\n    let _jid = queue.schedule::\u003cMyJob\u003e(vec![1, 2, 3], 0).await?;\n\n    // First create a job processor and router\n    let router = {\n        let mut r = RunnerRouter::default();\n        r.add_job_handler(MyJob);\n        r\n    };\n    // Setup runner to at most 10 jobs concurrently\n    let mut runner = JobRunner::new(queue, router, 10, RunnerOptions::default());\n    // Poll the queue every second, this will block unless something went really wrong.\n    // The future supplied as the second parameter will tell the server to shut down when it completes.\n    runner\n        .run_with_shutdown(Duration::seconds(1), async move {\n            // To avoid blocking this doctest, run for 10 milliseconds, then initiate shutdown.\n            tokio::time::sleep(std::time::Duration::from_millis(10)).await;\n            // In a real application, you may want to wait for a CTRL+C event or something similar.\n            // You could do this with tokio using the signal module: tokio::signal::ctrl_c().await.expect(\"failed to install CTRL+C signal handler\");\n        })\n        .await?;\n    Ok(())\n}\n```\n\n## License\n\nI decided to follow the same licensing model as aide-de-camp, so be welcome to choose either of the following based on your use case:\n\nApache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)\nMIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgistia%2Faide-de-camp-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgistia%2Faide-de-camp-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgistia%2Faide-de-camp-mongodb/lists"}