Skip to main content

hyperlane_plugin_sse/
lib.rs

1//! hyperlane-plugin-sse
2//!
3//! High-concurrency Server-Sent Events (SSE) framing, 64-way sharded topic
4//! pub/sub fan-out, bounded `Last-Event-ID` replay, and zero-allocation
5//! streaming heartbeats for Hyperlane.
6
7mod r#const;
8mod r#enum;
9mod r#fn;
10mod r#impl;
11mod r#static;
12mod r#struct;
13mod r#type;
14
15#[cfg(test)]
16#[path = "../tests/mod.rs"]
17mod tests;
18
19pub use {r#const::*, r#enum::*, r#struct::*};
20
21pub(crate) use {r#fn::*, r#static::*, r#type::*};
22
23use std::{
24    array::from_fn,
25    cell::{RefCell, RefMut},
26    collections::{HashMap, VecDeque},
27    error::Error,
28    fmt::{self, Display, Formatter},
29    hash::{BuildHasherDefault, Hasher},
30    mem::take,
31    pin::{Pin, pin},
32    str::from_utf8,
33    sync::{
34        Arc, Mutex, MutexGuard, OnceLock, RwLock, RwLockReadGuard, RwLockWriteGuard, Weak,
35        atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering},
36    },
37    time::Duration,
38};
39
40use {
41    hyperlane::{
42        CACHE_CONTROL, CONTENT_TYPE, Context, ResponseError, Stream,
43        tokio::{
44            runtime::{Handle, Id},
45            select, spawn,
46            sync::{
47                Notify,
48                futures::Notified,
49                watch::{self, Receiver, Sender},
50            },
51            task::JoinHandle,
52            time::{Instant, Interval, MissedTickBehavior, interval},
53        },
54    },
55    lombok_macros::*,
56};