1 unstable release

new 0.1.0 May 19, 2025

#16 in #watcher

MIT/Apache

30KB
544 lines

Watchable values.

A Watchable exists to keep track of a value which may change over time. It allows observers to be notified of changes to the value. The aim is to always be aware of the last value, not to observe every value change.

In that way, a Watchable is like a tokio::sync::broadcast::Sender (and a Watcher is like a tokio::sync::broadcast::Receiver), except that there's no risk of the channel filling up, but instead you might miss items.

This crate is meant to be imported like this (if you use all of these things):

use n0_watcher::{Watchable, Watcher as _};

n0-watcher

Watchable values.

A Watchable exists to keep track of a value which may change over time. It allows observers to be notified of changes to the value. The aim is to always be aware of the last value, not to observe every value change.

In that way, a Watchable is like a tokio::sync::broadcast::Sender, except that there's no risk of the channel filling up, but instead you might miss items.

License

Copyright 2025 N0, INC.

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~4–30MB
~412K SLoC