{"id":17272897,"url":"https://github.com/tomusdrw/rust-executors","last_synced_at":"2026-07-14T11:30:16.901Z","repository":{"id":66213602,"uuid":"52347710","full_name":"tomusdrw/rust-executors","owner":"tomusdrw","description":null,"archived":false,"fork":false,"pushed_at":"2016-02-23T09:42:54.000Z","size":1265,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-04-10T03:12:43.823Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomusdrw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-23T09:36:41.000Z","updated_at":"2023-05-06T23:06:08.893Z","dependencies_parsed_at":"2023-05-06T23:06:08.731Z","dependency_job_id":null,"html_url":"https://github.com/tomusdrw/rust-executors","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomusdrw%2Frust-executors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomusdrw%2Frust-executors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomusdrw%2Frust-executors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomusdrw%2Frust-executors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomusdrw","download_url":"https://codeload.github.com/tomusdrw/rust-executors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219844710,"owners_count":16556482,"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":[],"created_at":"2024-10-15T08:49:43.888Z","updated_at":"2026-07-14T11:30:16.825Z","avatar_url":"https://github.com/tomusdrw.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust-executors\n## A set of utilities to abstract tasks execution.\n\nTasks can be executed in the same thread, multiple threads (pool) or you can\ncontrol when and in which thread the tasks are consumed.\n\n[Docs](https://tomusdrw.github.io/rust-executors/executors)\n\n## Examples\n```rust\n// given\nlet e = Executors::same_thread();\n//let e = Executors::thread_pool(1);\n\n// when\nlet future: Future\u003cusize, ()\u003e = e.execute(Executors::task(|| Ok(4)));\n\n// then\nassert_eq!(4, future.await().unwrap());\n```\n\n```rust\n// Manual executor (use `consume`)\nlet e = Executors::test_executor();\n\nlet future = e.execute(Executors::task(|| Ok(4)));\nlet future2 = e.execute(Executors::task(|| Ok(5)));\nlet future3 = e.execute(Executors::task(|| Err(6)));\nassert_eq!(3, e.queued());\ne.consume(3);\n\nassert_eq!(4, future.await().unwrap());\nassert_eq!(5, future2.await().unwrap());\nassert_eq!(6, future3.await().unwrap_err().unwrap());\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomusdrw%2Frust-executors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomusdrw%2Frust-executors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomusdrw%2Frust-executors/lists"}