Skip to content

Support for async #2

Open
Open
@pulsastrix

Description

@pulsastrix

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions