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
40
41
42
43
44
45
//! Delivery metadata injectable into `#[photon::subscribe]` handlers (v2).
/// Delivery metadata for a single handler invocation.
///
/// Inject as a trailing parameter on a `#[photon::subscribe]` handler (after actor and
/// payload), alone or alongside `&Event`:
///
/// ```ignore
/// #[photon::subscribe(topic = "orders", durable = "worker")]
/// async fn on_order(
/// _actor: Box<dyn Actor>,
/// order: OrderPlaced,
/// ctx: HandlerCtx<'_>,
/// ) -> photon::Result<()> {
/// tracing::info!(event_id = %ctx.event_id, seq = ctx.seq, "handling");
/// Ok(())
/// }
/// ```
///
/// Values borrow from the transport [`crate::models::Event`] passed to the generated
/// invoker for the duration of the handler future.