A11 (C++ runtime)
Native C++ implementation of the A11 action and streaming runtime
Loading...
Searching...
No Matches
a11::service Namespace Reference

Classes

struct  ReceivedSessionMessage
 An inbound wire message paired with the id of the stream it arrived on. 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 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

absl::StatusOr< data::ByteMapNormalizeSessionHeaders (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.
 

Typedef Documentation

◆ OnSessionStreamDone

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.

◆ OnSessionStreamMessage

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.

Enumeration Type Documentation

◆ StreamMode

Whether this side starts (kStart) or accepts (kAccept) a stream during its startup handshake.

Enumerator
kStart 
kAccept 

Function Documentation

◆ NormalizeSessionHeaders()

absl::StatusOr< data::ByteMap > a11::service::NormalizeSessionHeaders ( data::ByteMap  headers)

Validate and case-normalize session headers.

Parameters
headersThe raw headers to normalize.
Returns
The normalized headers, or an error status if invalid.

Variable Documentation

◆ kMaxSingleMessageSize

constexpr size_t a11::service::kMaxSingleMessageSize = 32 * 1024 * 1024
inlineconstexpr

Hard upper bound for any one WireMessage admitted by a Session.

◆ kSessionStatusHeader

constexpr std::string_view a11::service::kSessionStatusHeader = "x-a11-session-status"
inlineconstexpr

Trailer/header used to communicate the session's structured terminal status.