{"id":13822576,"url":"https://github.com/irrustible/async-oneshot","last_synced_at":"2025-04-06T07:14:39.704Z","repository":{"id":48423654,"uuid":"284992110","full_name":"irrustible/async-oneshot","owner":"irrustible","description":"A fast, small, full-featured, no-std compatible oneshot channel","archived":false,"fork":false,"pushed_at":"2023-11-28T20:54:20.000Z","size":144,"stargazers_count":60,"open_issues_count":4,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T06:06:46.159Z","etag":null,"topics":["async","async-await","channels","concurrency","futures"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/irrustible.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-08-04T13:43:34.000Z","updated_at":"2025-02-13T19:12:38.000Z","dependencies_parsed_at":"2024-06-19T19:14:37.830Z","dependency_job_id":null,"html_url":"https://github.com/irrustible/async-oneshot","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irrustible%2Fasync-oneshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irrustible%2Fasync-oneshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irrustible%2Fasync-oneshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irrustible%2Fasync-oneshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/irrustible","download_url":"https://codeload.github.com/irrustible/async-oneshot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445681,"owners_count":20939961,"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":["async","async-await","channels","concurrency","futures"],"created_at":"2024-08-04T08:02:06.858Z","updated_at":"2025-04-06T07:14:39.684Z","avatar_url":"https://github.com/irrustible.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# async-oneshot\n\n\u003c!--\n[![License](https://img.shields.io/crates/l/async-oneshot.svg)](https://github.com/irrustible/async-oneshot/blob/main/LICENSE)\n[![Package](https://img.shields.io/crates/v/async-oneshot.svg)](https://crates.io/crates/async-oneshot)\n[![Documentation](https://docs.rs/async-oneshot/badge.svg)](https://docs.rs/async-oneshot)\n\nA fast, small, full-featured, async-aware oneshot channel.\n\nFeatures:\n\n* Tiny code, only one dependency and a lightning quick build.\n* Complete `no_std` support (with `alloc` for `Arc`).\n* Unique feature: sender may wait for a receiver to be waiting.\n\n## Usage\n\n```rust\n#[test]\nfn success_one_thread() {\n    let (s,r) = oneshot::\u003cbool\u003e();\n    assert_eq!((), s.send(true).unwrap());\n    assert_eq!(Ok(true), future::block_on(r));\n}\n```\n\n## Note on safety\n\nThis crate uses UnsafeCell and manually synchronises with atomic\nbitwise ops for performance. We believe it is correct, but we\nwould welcome more eyes on it.\n\n# See Also\n\n* [async-oneshot-local](https://github.com/irrustible/async-oneshot-local) (single threaded)\n* [async-spsc](https://github.com/irrustible/async-spsc) (SPSC)\n* [async-channel](https://github.com/stjepang/async-channel) (MPMC)\n\n## Note on benchmarking\n\nThe benchmarks are synthetic and a bit of fun.\n\n## Changelog\n\n### v0.6.0\n\nFixes:\n\n* Fix possible race conditions by implementing spinlocks.\n  For now this degrades performance slightly, but it should \n  get rid of race conditions.\n\nBreaking changes:\n\n* Bumped Rust edition to 2021.\n\nImprovements:\n\n* Get rid of all runtime dependencies.\n\n### v0.5.0\n\nBreaking changes:\n\n* Make `Sender.send()` only take a mut ref instead of move.\n\n### v0.4.2\n\nImprovements:\n\n* Added some tests to cover repeated fix released in last version.\n* Inline more aggressively for some nice benchmark boosts.\n\n### v0.4.1\n\nFixes:\n\n* Remove some overzealous `debug_assert`s that caused crashes in\n  development in case of repeated waking. Thanks @nazar-pc!\n\nImprovements:\n\n* Better benchmarks, based on criterion.\n\n### v0.4.0\n\nBreaking changes:\n\n* `Sender.wait()`'s function signature has changed to be a non-`async\n  fn` returning an `impl Future`. This reduces binary size, runtime\n  and possibly memory usage too. Thanks @zserik!\n\nFixes:\n\n* Race condition where the sender closes in a narrow window during\n  receiver poll and doesn't wake the Receiver. Thanks @zserik!\n\nImprovements:\n\n * Static assertions. Thanks @zserik!\n\n### v0.3.3\n\nImprovements:\n\n* Update `futures-micro` and improve the tests\n\n### v0.3.2\n\nFixes:\n\n* Segfault when dropping receiver. Caused by a typo, d'oh! Thanks @boardwalk!\n\n### v0.3.1\n\nImprovements:\n\n* Remove redundant use of ManuallyDrop with UnsafeCell. Thanks @cynecx!\n\n### v0.3.0\n\nImprovements:\n\n* Rewrote, benchmarked and optimised.\n\n### v0.2.0\n\n* First real release.\n\n--\u003e\n## Copyright and License\n\nCopyright (c) 2020 James Laver, async-oneshot contributors.\n\nThis Source Code Form is subject to the terms of the Mozilla Public\nLicense, v. 2.0. If a copy of the MPL was not distributed with this\nfile, You can obtain one at http://mozilla.org/MPL/2.0/.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firrustible%2Fasync-oneshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firrustible%2Fasync-oneshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firrustible%2Fasync-oneshot/lists"}