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

Support for async #2

Open
3 tasks
pulsastrix opened this issue Nov 19, 2022 · 0 comments
Open
3 tasks

Support for async #2

pulsastrix opened this issue Nov 19, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@pulsastrix
Copy link
Member

Summary

Allow libcoap-rs to be used inside of async runtimes like Tokio without spawning a blocking thread.

Description

The libcoap C-library has its own implementation of IO handling described in the coap_io man page. This implementation involves setting up epoll or select to poll for IO events.

This does not work well with async runtimes provided in Rust, because they are designed to handle polling for IO events on their own and to notify other parts of the software when IO happens.
Because of this, libcoap will have to be run in a separate blocking thread if an async runtime is to be used.
To solve this, we should adapt libcoap to allow using other IO loops defined in rust (like the aforementioned async runtimes)

Implementation steps

  • Rewrite IO handling of libcoap in wrapper library
  • Find a way to adapt libcoap to use our IO handling
  • Adapt libcoap's async functions where applicable

(Issue moved over from GitLab)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant