|
A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
|
Namespaces | |
| namespace | internal |
Classes | |
| struct | ReceivedSessionMessage |
| An inbound wire message paired with the id of the stream it arrived on. More... | |
| class | Service |
| A registry of actions, the sessions serving them, and their lifecycle. More... | |
| struct | ServiceOptions |
| How a service treats the connections it accepts. More... | |
| class | Session |
| A connection-scoped runtime that multiplexes wire streams and runs actions. More... | |
| struct | SessionOptions |
| Limits and timeouts governing a Session's buffering, concurrency, and lifetime. More... | |
| class | SessionWithRecv |
| A Session variant that buffers inbound messages for pull-style reception. More... | |
Typedefs | |
| using | OnServiceConnection = std::function< a11::Task(std::shared_ptr< Session >, std::shared_ptr< net::WireStream >)> |
| Per-connection preparation, run before the session starts pumping. | |
| using | OnSessionStreamMessage = std::function< a11::Task(std::optional< data::WireMessage >, std::shared_ptr< net::WireStream >, std::shared_ptr< Session >)> |
| Callback invoked for each message received on a session stream (nullopt signals end-of-stream); may be a coroutine. | |
| using | OnSessionStreamDone = std::function< a11::Task(std::shared_ptr< net::WireStream >, std::shared_ptr< Session >)> |
| Callback invoked once a session stream has finished; may be a coroutine. | |
Enumerations | |
| enum class | StreamMode { kStart , kAccept } |
Whether this side starts (kStart) or accepts (kAccept) a stream during its startup handshake. More... | |
Functions | |
| template<typename StreamT > | |
| std::function< a11::Task(std::shared_ptr< StreamT >)> | AcceptInto (const std::shared_ptr< Service > &service, StreamMode mode=StreamMode::kAccept) |
A callback for any transport's on-stream hook, serving into service. | |
| absl::StatusOr< data::ByteMap > | NormalizeSessionHeaders (data::ByteMap headers) |
| Validate and case-normalize session headers. | |
Variables | |
| constexpr std::string_view | kSessionStatusHeader = "x-a11-session-status" |
| Trailer/header used to communicate the session's structured terminal status. | |
| constexpr size_t | kMaxSingleMessageSize = 32 * 1024 * 1024 |
| Hard upper bound for any one WireMessage admitted by a Session. | |
| using a11::service::OnServiceConnection = typedef std::function<a11::Task( std::shared_ptr<Session>, std::shared_ptr<net::WireStream>)> |
Per-connection preparation, run before the session starts pumping.
Called once per accepted stream, after its Session exists and before AddStream, which is the only window in which a connection can be specialised without racing its first message. Both handles are passed because the useful things need both: swapping in a registry copy carrying this peer's own actions, or binding a bridge that reverse-dispatches calls back over this very stream.
A non-OK Task rejects the connection: the stream is aborted with that status and the session never runs.
| using a11::service::OnSessionStreamDone = typedef std::function<a11::Task( std::shared_ptr<net::WireStream>, std::shared_ptr<Session>)> |
Callback invoked once a session stream has finished; may be a coroutine.
| using a11::service::OnSessionStreamMessage = typedef std::function<a11::Task( std::optional<data::WireMessage>, std::shared_ptr<net::WireStream>, std::shared_ptr<Session>)> |
Callback invoked for each message received on a session stream (nullopt signals end-of-stream); may be a coroutine.
|
strong |
| std::function< a11::Task(std::shared_ptr< StreamT >)> a11::service::AcceptInto | ( | const std::shared_ptr< Service > & | service, |
| StreamMode | mode = StreamMode::kAccept |
||
| ) |
A callback for any transport's on-stream hook, serving into service.
Holds a weak reference, so a server that outlives its service rejects new connections instead of dereferencing a destroyed one.
| StreamT | The concrete stream type the transport hands out. |
| absl::StatusOr< data::ByteMap > a11::service::NormalizeSessionHeaders | ( | data::ByteMap | headers | ) |
Validate and case-normalize session headers.
| headers | The raw headers to normalize. |
|
inlineconstexpr |
Hard upper bound for any one WireMessage admitted by a Session.
|
inlineconstexpr |
Trailer/header used to communicate the session's structured terminal status.