2 unstable releases

Uses old Rust 2015

0.1.0 Jun 10, 2017
0.0.1 May 28, 2017

#7 in #sender-receiver

Download history 19/week @ 2024-07-20 25/week @ 2024-07-27 25/week @ 2024-08-03 16/week @ 2024-08-10 13/week @ 2024-08-17 21/week @ 2024-08-24 53/week @ 2024-08-31 13/week @ 2024-09-07 12/week @ 2024-09-14 40/week @ 2024-09-21 22/week @ 2024-09-28 6/week @ 2024-10-05 13/week @ 2024-10-12 16/week @ 2024-10-19 11/week @ 2024-10-26 20/week @ 2024-11-02

60 downloads per month
Used in 10 crates (4 directly)

MPL-2.0 license

52KB
884 lines

dharma crate provides high-level multi-threading support.

bridge module

bridge module provides similar functionality as standard spmc but instead of producing fixed pairs Sender-Receiver it allows to connect them freely, so we can have many one Sender sending to many Receivers and one Receiver listening to many senders in flexible, configurable way.

signaler module

On to of that we add Signaler which can subscribe receivers for signals (application defined events) creating notification mechanism.

event_loop module

On top of Signaler we add EventLoop, which is event queue assigned to thread. EventLoop has assigned Modules constituting separate application components. Modules can be assigned to EventLoops in flexible way making it easy to control tasks processed in threads. Modules do not share memory and communicate with signals.

dispatcher module

Every threading framework should provide mechanism for listening on system events. Dispatcher allows to register EventHandlers (wrapping file descriptors) and invokes them when system events they are assigned are ready to be processed.

system module

Last module contains helper code for and handling system signals.

Dependencies

~1.5MB
~37K SLoC