Skip to content

Conversation

@MikeIvanichev
Copy link

@MikeIvanichev MikeIvanichev commented Oct 22, 2024

Adding blocking methods to the async mpsc channel

Addresses: #26

This PR aims to implement a bridge between blocking and sync code by adding blocking methods
to the async mpsc::{Sender, Receiver}.

The implementation follows the suggestions in #26, wrapping a Thread in a Waker when using a blocking method.

Progress

All things marked as completed have been implemented and documented.

  • Impl tests
  • Impl loom tests
  • Loom testing (2 preemptions)
  • Impl benchmarks

mpsc::Sender

  • blocking_send_ref
  • blocking_send_ref_timeout
  • blocking_send
  • blocking_send_timeout

mpsc::Receiver

  • blocking_recv_ref
  • blocking_recv_ref_timeout
  • blocking_recv
  • blocking_recv_timeout

mpsc::StaticSender

  • blocking_send_ref
  • blocking_send_ref_timeout
  • blocking_send
  • blocking_send_timeout

mpsc::StaticReceiver

  • blocking_recv_ref
  • blocking_recv_ref_timeout
  • blocking_recv
  • blocking_recv_timeout

@MikeIvanichev
Copy link
Author

Hi @hawkw,
Though this isn't done yet, I wanted to get your opinion on the direction I'm going earlier rather than later.

Please let me know if there are things I could do better, or that you would prefer be implemented differently.

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

Successfully merging this pull request may close these issues.

1 participant