1pub use crate::common::event::{
4 BackboneInterfaceEntry, BackbonePeerHookEvent, BackbonePeerPoolMemberStatus,
5 BackbonePeerPoolStatus, BackbonePeerStateEntry, BlackholeInfo, DrainStatus, HolePunchPolicy,
6 HookInfo, InterfaceStatsResponse, KnownDestinationEntry, LifecycleState, LinkInfoEntry,
7 LocalDestinationEntry, NextHopResponse, PathTableEntry, ProviderBridgeConsumerStats,
8 ProviderBridgeStats, QueryRequest, QueryResponse, RateTableEntry, ResourceInfoEntry,
9 RuntimeConfigApplyMode, RuntimeConfigEntry, RuntimeConfigError, RuntimeConfigErrorCode,
10 RuntimeConfigSource, RuntimeConfigValue, SingleInterfaceStat,
11};
12
13pub type Event = crate::common::event::Event<Box<dyn crate::interface::Writer>>;
15
16pub const DEFAULT_EVENT_QUEUE_CAPACITY: usize = 8192;
17
18pub type EventSender = std::sync::mpsc::SyncSender<Event>;
19pub type EventReceiver = std::sync::mpsc::Receiver<Event>;
20
21pub fn channel() -> (EventSender, EventReceiver) {
22 channel_with_capacity(DEFAULT_EVENT_QUEUE_CAPACITY)
23}
24
25pub fn channel_with_capacity(capacity: usize) -> (EventSender, EventReceiver) {
26 std::sync::mpsc::sync_channel(capacity.max(1))
27}