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

A pull-oriented HTTP/2 response body stream. More...

#include <cpp/a11/net/http2.h>

Inheritance diagram for a11::net::Http2ResponseStream:
[legend]

Classes

struct  State
 

Public Member Functions

a11::Future< HttpResponseHeadHeaders () const
 
a11::Future< std::optional< std::string > > Read ()
 
a11::Task Done () const
 
absl::Status Cancel (absl::Status status=absl::CancelledError("HTTP/2 request cancelled"))
 Cancels the response stream with the given status.
 
std::int32_t stream_id () const
 

Friends

class Http2Connection
 
class Http2Client
 

Detailed Description

A pull-oriented HTTP/2 response body stream.

Read() returns nullopt after a clean END_STREAM. Only one outstanding Read() is permitted, which provides a bounded handoff from the libuv thread to fibers and ordinary threads.

Member Function Documentation

◆ Cancel()

absl::Status a11::net::Http2ResponseStream::Cancel ( absl::Status  status = absl::CancelledError("HTTP/2 request cancelled"))

Cancels the response stream with the given status.

◆ Done()

a11::Task a11::net::Http2ResponseStream::Done ( ) const
Returns
An awaitable that resolves when the response is done.

◆ Headers()

a11::Future< HttpResponseHead > a11::net::Http2ResponseStream::Headers ( ) const
Returns
An awaitable resolving to the response status and headers.

◆ Read()

a11::Future< std::optional< std::string > > a11::net::Http2ResponseStream::Read ( )
Returns
An awaitable resolving to the next body chunk, or nullopt at end of stream.

◆ stream_id()

std::int32_t a11::net::Http2ResponseStream::stream_id ( ) const
Returns
The HTTP/2 stream identifier.

Friends And Related Symbol Documentation

◆ Http2Client

◆ Http2Connection


The documentation for this class was generated from the following files: