1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! [`Source`] trait: something that produces [`Event`]s.
//!
//! In the final wiring (Subtask 3), concrete implementations will include a
//! mesh adapter that turns `agent_mesh_sdk::RequestHandler::handle` calls
//! into events pushed to the bus.
//!
//! Sources that need a response from the Lua handler (request/response
//! round-trip) construct events via [`Event::with_ack`] and await the
//! receiver side themselves. Sources that are fire-and-forget use
//! [`Event::fire_and_forget`].
//!
//! Note: the `next()` API on this trait is kept for symmetry with
//! pull-style sources. The canonical wiring in `agent-block` uses a single
//! shared `mpsc::Sender<Event>` that sources push into directly (see
//! plan.md §設計選択 A1). `next()` is retained for adapters that prefer a
//! pull interface and for the in-crate mock used by `#[cfg(test)]` in the
//! dispatcher module.
use async_trait;
use crateEvent;
use crateBlockError;
/// A producer of [`Event`]s.
///
/// ST3 uses push-style ingress (`mpsc::Sender<Event>` cloned into each
/// adapter) and does not exercise this trait. Retained for ST4+ adapters
/// that prefer a pull interface.