All Projects → austinjones → postage-rs

austinjones / postage-rs

Licence: MIT License
The feature-rich, portable async channel library

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to postage-rs

SockNet
The easiest and fastest way to work with sockets in C#
Stars: ✭ 42 (-65.57%)
Mutual labels:  asynchronous
AutoOED
AutoOED: Automated Optimal Experimental Design Platform
Stars: ✭ 87 (-28.69%)
Mutual labels:  asynchronous
conductor
Mix both synchronous and asynchronous code without hassle
Stars: ✭ 58 (-52.46%)
Mutual labels:  asynchronous
RepositoryHelpers
📦 Extensions for HttpClient and Custom Repository based on dapper
Stars: ✭ 22 (-81.97%)
Mutual labels:  asynchronous
drone-cortexm
ARM® Cortex®-M platform crate for Drone, an Embedded Operating System.
Stars: ✭ 31 (-74.59%)
Mutual labels:  asynchronous
AlephBFT
Rust implementation of Aleph consensus protocol
Stars: ✭ 17 (-86.07%)
Mutual labels:  asynchronous
ring-channel
Bounded MPMC channel abstraction on top of a ring buffer
Stars: ✭ 24 (-80.33%)
Mutual labels:  asynchronous
xtra
🎭 A tiny actor framework
Stars: ✭ 111 (-9.02%)
Mutual labels:  asynchronous
futura
Asynchronous Swift made easy. The project was made by Miquido. https://www.miquido.com/
Stars: ✭ 34 (-72.13%)
Mutual labels:  asynchronous
python-logstash-async
Python logging handler for sending log events asynchronously to Logstash.
Stars: ✭ 141 (+15.57%)
Mutual labels:  asynchronous
lifeline-rs
A dependency injection library for message-based applications
Stars: ✭ 32 (-73.77%)
Mutual labels:  channels
awesome-dotnet-async
A curated list of awesome articles and resources to learning and practicing about async, threading, and channels in .Net platform. 😉
Stars: ✭ 84 (-31.15%)
Mutual labels:  channels
channelsmultiplexer
Channels v3 Multiplerxer
Stars: ✭ 25 (-79.51%)
Mutual labels:  channels
memsocket
An asynchronous in-memory socket-like interface for Rust
Stars: ✭ 34 (-72.13%)
Mutual labels:  asynchronous
MojangSharp
A C# wrapper library for Mojang API (no longer actively maintained)
Stars: ✭ 38 (-68.85%)
Mutual labels:  asynchronous
firetrap
This project is no longer maintained. Check out the fork (lib)unFTP instead.
Stars: ✭ 15 (-87.7%)
Mutual labels:  asynchronous
async-pidfd
Rust crate to use process file descriptors (pidfd) for Linux
Stars: ✭ 42 (-65.57%)
Mutual labels:  asynchronous
ustvgo to m3u
Grabs m3u links from ustvgo.tv
Stars: ✭ 35 (-71.31%)
Mutual labels:  channels
yerbie
A blazing fast job queue built for ease of use and scalability
Stars: ✭ 16 (-86.89%)
Mutual labels:  asynchronous
async-oneshot
A fast, small, full-featured, no-std compatible oneshot channel
Stars: ✭ 55 (-54.92%)
Mutual labels:  channels

The feature-rich, portable async channel library > crates.io > docs.rs

Why use Postage?

  • Includes a rich set of channels. | barrier | broadcast | dispatch | mpsc | oneshot | watch
  • Works with any executor.
    • Currently regressions are written for tokio and async-std.
    • With the futures-traits feature, channels implement the futures Sink/Stream traits.
  • Thoroughly tested.
    • Channels have full unit test coverage, and integration test coverage with multiple async executors.
  • Includes built-in Sink and Stream combinators.
    • Sinks can be chained and filtered.
    • Streams can be chained, filtered, mapped, and merged.
    • Sinks and streams can log their values, for easy app debugging.

Channels

postage::barrier

Barrier channels can be used to synchronize events, but do not transmit any data. When the sender is dropped (or tx.send(()) is called), the receiver is awoken. This can be used to asynchronously coordinate actions between tasks.

postage::broadcast

The broadcast channel provides reliable broadcast delivery between multiple senders and multiple receivers. The channel has a fixed capacity, and senders are suspended if the buffer is filled.

When a receiver is cloned, both receivers will be sent the same series of messages.

Senders also provide a subscribe() method which creates a receiver that will observe all messages sent after the call to subscribe.

postage::dispatch

The dispatch channel provides multi-sender, multi-receiver message dispatch. A message will be observed by at most one reciever. The channel has a fixed capacity, and senders are suspended if the buffer is filled.

Receivers can be created with rx.clone(), or tx.subscribe().

postage::mpsc

Postage includes a fixed-capacity multi-producer, single-consumer channel. The producer can be cloned, and the sender task is suspended if the channel becomes full.

postage::oneshot

Oneshot channels transmit a single value between a sender and a reciever. Neither can be cloned. If the sender drops, the receiver recieves a None value.

postage::watch

Watch channels can be used to asynchronously transmit state. When receivers are created, they immediately recieve an initial value. They will also recieve new values, but are not guaranteed to recieve every value.

Values transmitted over watch channels must implement Default. A simple way to achieve this is to transmit Option<T>.

Benchmarks

Benchmarks of postage channels, and comparable async-std/tokio channels.

  • send/recv measures the total time to send and receive an item.
  • send full measures the time to send an item and get a Poll::Pending value on a full channel.
  • recv empty measures the time to get a Poll::Pending value on an empty channel.

All benchmarks were taken with criterion and are in the benches directory.

Package Channel send/recv send full recv empty
broadcast postage 144ns 6ns 7ns
broadcast tokio 88ns (-38%) 49ns 39ns
-
dispatch postage 87ns 26ns 26ns
dispatch async_std 41ns (-52%) 10ns 10ns
-
mpsc postage 79ns 25ns 27ns
mpsc tokio 132ns (+67%) 1ns 31ns
-
watch postage 96ns - 7ns
watch tokio 74ns (-22%) - 75ns
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].