feat: add multiple channel providers

Each provider is enabled via a feature flag.
The currently implemented providers are:
- std::mpsc
- flume
- crossbeam_channel
This commit is contained in:
Callum Leslie 2025-09-04 09:37:55 +01:00
parent 6b754e13e8
commit faa5ba23c5
Signed by: cleslie
GPG key ID: D382C4AFEECEAA90
10 changed files with 761 additions and 189 deletions

View file

@ -12,14 +12,14 @@ pub enum Response<T> {
}
/// Represents the source of values: either static or dynamic
pub enum ValueSource<T> {
pub(crate) enum ValueSource<T> {
Static(T),
Dynamic(Box<dyn Fn() -> T + Send + Sync + 'static>),
None,
}
/// Internal channel state shared between producer and consumer
pub struct ChannelState<T> {
pub source: ValueSource<T>,
pub closed: bool,
pub(crate) struct ChannelState<T> {
pub(crate) source: ValueSource<T>,
pub(crate) closed: bool,
}