#channel #message #split #data-processing #abstraction #synchronization #send

split_channel

split_channel provides a stream-of-messages abstraction with split send/recv channels

8 breaking releases

0.10.0 Oct 8, 2024
0.8.0 Sep 5, 2024
0.5.0 Feb 19, 2024
0.4.0 Dec 27, 2023
0.1.0 Jul 10, 2023

#263 in Concurrency

Download history 66/week @ 2024-07-28 128/week @ 2024-08-18 4/week @ 2024-08-25 120/week @ 2024-09-01 5/week @ 2024-09-08 164/week @ 2024-09-15 8/week @ 2024-09-22 74/week @ 2024-09-29 155/week @ 2024-10-06 9/week @ 2024-10-13

238 downloads per month
Used in busybee

Apache-2.0

260KB
6K SLoC

split_channel

split_channel provides a stream-of-messages abstraction with split send/recv channels.

Status

Maintenance track. The library is considered stable and will be put into maintenance mode if unchanged for one year. Documentation changes excepted.

Scope

This library provides the abstraction of split send/recv channels. This is a hack of the type system, allowing two &mut references to the same underlying types.

Warts

  • I'm not a fan of the name.

Documentation

The latest documentation is always available at docs.rs.


lib.rs:

split_channel provides a stream-of-messages abstraction with split send/recv channels. Most calls that establish a channel return a tuple of ([RecvChannel], [SendChannel]).

The key idea here is that an &mut RecvChannel and &mut SendChannel exist for the same SslStream<TcpStream>, allowing parallel sending and processing of messages. The general pattern is to lock the send channel, send data, and then use sync42::wait_list::WaitList to synchronize receivers.

Dependencies

~32MB
~832K SLoC