mirror of
https://github.com/callumio/suck.git
synced 2025-12-17 11:39:20 +00:00
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:
parent
6b754e13e8
commit
faa5ba23c5
10 changed files with 761 additions and 189 deletions
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue