Crates.io | nosy |
lib.rs | nosy |
version | 0.2.0 |
created_at | 2024-12-19 23:35:07.482698+00 |
updated_at | 2025-08-24 22:38:37.041406+00 |
description | Change notification / observation / broadcast channels, with filtering and coalescing. no_std compatible. |
homepage | |
repository | https://github.com/kpreid/nosy/ |
max_upload_size | |
id | 1489668 |
size | 200,375 |
nosy
nosy
is a Rust library for broadcasting messages/events such as change notifications.
The niche which nosy
seeks to fill is: delivering precise change notifications
(e.g. “these particular elements of this collection have changed”) from a data source
to a set of listeners (observers) in such a way that
The tradeoff we make in order to achieve this is that message delivery does involve execution of a small amount of code on behalf of each listener; this code is responsible for deciding whether the message is of interest, and if so, storing it or its implications for later reading. (We could say that the listeners are nosy.)
Because of this strategy, nosy
is not a good choice if you expect to have very many listeners
of the same character (e.g. many identical worker tasks updating their state); in those cases,
you would probably be better off using a conventional broadcast channel or watch channel.
It is also not a good choice if it is critical that no third-party code executes on your thread
or while your function is running.
nosy
is compatible with no_std
platforms.
The minimum requirements for using nosy
are the following.
(All platforms which support std
meet these requirements, and many others do too.)
alloc
standard library crate, and a global allocator.u8
-sized atomics (cfg(target_has_atomic = "ptr")
and cfg(target_has_atomic = "8")
).Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.