Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate sync API async API #7

Open
2bndy5 opened this issue Nov 22, 2024 · 0 comments
Open

generate sync API async API #7

2bndy5 opened this issue Nov 22, 2024 · 0 comments

Comments

@2bndy5
Copy link
Member

2bndy5 commented Nov 22, 2024

I just ran across this procedural macro (function that generates code at compile time) library called maybe-async-cfg.

Basically, this would allow conditionally exposing/compiling async or sync (or both) flavored APIs. The beauty is that we'd only have to write the async code, and this maybe-async-cfg library will generate the sync flavored API.

Considerations

  1. This isn't hard requirement. User's can still wrap sync code in an async runtime tasks.
  2. Addressing this may not be as easy as adding await and async keywords where applicable.
  3. The library already has a block-less RF24::write() function designed for using interrupts...
  4. Node.js binding (using napi-rs project) support exposing (rust native) async code
  5. Python binding (using pyo3) does not yet officially support exposing (rust native) async code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant