A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
http_sse_wire_stream.h File Reference

WireStream transport over HTTP Server-Sent Events. More...

#include <cstdint>
#include <functional>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#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"
This graph shows which files directly or indirectly include this file:

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).
 

Detailed Description

WireStream transport over HTTP Server-Sent Events.

The server sends WireMessages as Server-Sent Events; the client sends them through a companion HTTP request. HTTP/2 carries both directions on one connection. HTTP/1.1 uses a second connection with a streamed request body or one POST per message. Readers receive delivered messages before closure; separate streams have no global ordering guarantee.