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
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
orselect
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
(Issue moved over from GitLab)