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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
//! Durable executor continuation.
//!
//! Adopters on runtimes that cannot guarantee post-return
//! `tokio::spawn` continuation (AWS Lambda in particular) can opt in to
//! a durable executor dispatch path by wiring a [`DurableExecutorQueue`]
//! implementation. When wired, [`crate::router::core_send_message`] on
//! the `return_immediately = true` path enqueues a
//! [`QueuedExecutorJob`] envelope on the queue instead of spawning the
//! executor locally; a separate invocation consumes the queue and runs
//! the executor to terminal.
//!
//! The trait is the integration point. First-party impls ship in
//! `turul-a2a-aws-lambda` behind the `sqs` feature
//! (`SqsDurableExecutorQueue`); adopters may provide alternative
//! backends (Kinesis, SNS+queue, Step Functions task token, etc.) by
//! implementing this trait directly.
//!
//! See also: ADR-017 (`RuntimeConfig::supports_return_immediately`
//! capability gate) and ADR-013 (Lambda push-delivery parity).
use async_trait;
use ;
/// Versioned SQS / durable-queue payload for an executor dispatch.
///
/// Serialised to the queue at enqueue time and deserialised on
/// consume. Carries enough context for the consumer to run the
/// executor without re-validating any of the HTTP-side auth (which
/// already succeeded to reach enqueue) — the `owner` and `claims`
/// fields encode the authenticated identity.
///
/// Schema evolution: `version` defaults to the current shape's
/// number. Consumers reject unknown versions at dequeue, which surfaces
/// as a batch-item failure so the record can be retried or DLQ'd once
/// the consumer's code catches up.
/// Errors returned by [`DurableExecutorQueue`] implementations.
/// Durable executor queue — the integration point for Pattern B
/// (framework-managed durable continuation).
///
/// **Public extension point, semver-sensitive.** External
/// implementers should treat method additions (and signature changes)
/// as semver-minor breaking changes for their crates. First-party
/// impls ship behind `turul-a2a-aws-lambda`'s `sqs` feature
/// (`SqsDurableExecutorQueue`). Adopters may provide alternative
/// backends by implementing this trait directly, but must be ready to
/// re-implement against new methods when the trait evolves.