https://github.com/jdonszelmann/blocker
Block rust futures to create a synchronous wrapper around an asynchronous api
https://github.com/jdonszelmann/blocker
Last synced: 3 months ago
JSON representation
Block rust futures to create a synchronous wrapper around an asynchronous api
- Host: GitHub
- URL: https://github.com/jdonszelmann/blocker
- Owner: jdonszelmann
- License: apache-2.0
- Created: 2020-12-15T22:40:10.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-15T23:16:28.000Z (over 5 years ago)
- Last Synced: 2025-11-16T22:07:56.689Z (8 months ago)
- Language: Rust
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://codecov.io/gh/jonay2000/blocker)
[](https://docs.rs/blocker)
[](https://crates.io/crates/blocker)
# Blocker!
Blocker blocks. That's what it does, nothing more. Give it an async function and it waits until it's done. Forever.
Works in `#![no_std]` environments as long as alloc is available. Blocker does not rely on unsafe code.
Enable the `thread_yield` feature to yield the current thread whenever an async function returns `Poll::pending`.
# License
This code is licensed under the [Apache 2.0 license](./LICENSE)