|
A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
|
WireStream transport over HTTP Server-Sent Events. More...
#include <cstdint>#include <functional>#include <memory>#include <optional>#include <string>#include <absl/base/nullability.h>#include <absl/status/status.h>#include <absl/status/statusor.h>#include <absl/time/time.h>#include "a11/concurrency/future.h"#include "a11/data/types.h"#include "a11/net/describe_endpoint.h"#include "a11/net/http2.h"#include "a11/net/in_process_wire_stream.h"#include "a11/net/server_headers.h"#include "a11/net/wire_stream.h"Go to the source code of this file.
Classes | |
| struct | a11::net::HttpSseOptions |
| Endpoint paths and transport tuning for an HTTP SSE wire stream. More... | |
| class | a11::net::HttpSseWireStream |
| Common base for the client and server HTTP SSE wire streams. More... | |
| class | a11::net::HttpSseClientWireStream |
| The client-side HTTP SSE wire stream, dialing out to a server URL. More... | |
| class | a11::net::HttpSseServerWireStream |
| The server-side HTTP SSE wire stream, accepted from a client. More... | |
| class | a11::net::HttpSseServer |
| Hosts HTTP SSE wire streams on top of an HTTP/2 server. More... | |
Namespaces | |
| namespace | a11 |
| namespace | a11::net |
Typedefs | |
| using | a11::net::OnHttpSseConnect = std::function< a11::Task(std::shared_ptr< HttpSseServerWireStream >)> |
| Callback invoked with each accepted server-side SSE wire stream. | |
| using | a11::net::HttpSseWireStreamServer = HttpSseServer |
| Alias for HttpSseServer, spelled to match the WireStream naming family. | |
Enumerations | |
| enum class | a11::net::SseOutboundDelivery { a11::net::kPost , a11::net::kStream } |
| How an SSE client hands its outbound WireMessages to the server. More... | |
Variables | |
| constexpr std::string_view | a11::net::kSseStreamIdHeader = "x-a11-stream-id" |
| Response header naming the stream id assigned to an SSE connection. | |
| constexpr std::string_view | a11::net::kSseHttpHeaderPrefix = "x-a11-http-" |
| Prefix under which application HTTP headers are tunneled over SSE. | |
| constexpr std::string_view | a11::net::kSseOutboundModesHeader = "x-a11-outbound" |
Response header on the connect response listing the outbound delivery modes the server accepts, comma-separated – post, stream. | |
| constexpr std::string_view | a11::net::kSseOutboundPostToken = "post" |
| Token for one-POST-per-message outbound delivery. | |
| constexpr std::string_view | a11::net::kSseOutboundStreamToken = "stream" |
| Token for long-lived-request-body outbound delivery. | |
| constexpr std::string_view | a11::net::kSseWireStreamContentType |
| Content type of a streamed outbound request body. | |
| constexpr std::string_view | a11::net::kDefaultSseConnectEndpoint = "/connect" |
| Default path on which a client opens the SSE event stream. | |
| constexpr std::string_view | a11::net::kDefaultSseMessageEndpoint |
Default message-post path template ({id} is the stream id). | |
WireStream transport over HTTP Server-Sent Events.
An HttpSseWireStream carries A11 WireMessage traffic over an HTTP channel: the server streams messages back as Server-Sent Events while the client posts outgoing messages to a companion endpoint. Pick this transport when only ordinary HTTP is available – it is a firewall- and proxy-friendly alternative to WebSockets. HttpSseClientWireStream dials out, HttpSseServerWireStream is the accepted counterpart, and HttpSseServer hosts them. Delivery carries no global ordering guarantee but is synchronised on closure – a reader observes every delivered message before the stream completes.
Over HTTP/2 the event stream and the outbound direction are streams on one connection. HTTP/1.1 has no multiplexing and an A11 client connection carries a single request, so the outbound direction needs a connection of its own: either one for all of it (a streamed request body, which a non-multiplexed connection prefers whenever the server advertises it) or one per message (POST delivery, the interop fallback). Nothing about the protocol changes – only how many sockets it takes.