modulink_rs/listeners/
mod.rs

1pub mod http_listener;
2pub use http_listener::HttpListener;
3
4use async_trait::async_trait;
5
6/// Trait for sync listeners (blocking triggers, CLI, etc)
7pub trait BaseListenerSync: Send + Sync {
8    /// Start the listener (sync)
9    fn start(&self) -> std::io::Result<()>;
10    /// Listener name/type
11    fn name(&self) -> &'static str;
12}
13
14/// Trait for async listeners (HTTP, SSE, async stdio, etc)
15#[async_trait]
16pub trait BaseListenerAsync: Send + Sync {
17    /// Start the listener (async)
18    async fn start(&self) -> std::io::Result<()>;
19    /// Listener name/type
20    fn name(&self) -> &'static str;
21}
22
23// Ergonomic aliases for both sync and async listeners
24pub use self::BaseListenerSync as ListenerSync;
25pub use self::BaseListenerAsync as ListenerAsync;