Esc

Http2_Channel

structextensionexperimentalsince 0.36.1Source
  • macOS: Http2_Channel works on macOS
  • Linux: Http2_Channel works on Linux
  • Windows: Http2_Channel works on Windows
  • Wasm: Http2_Channel works on Wasm

Declaration

Http2_Channel :: struct {
    base_url: string;    tls: *Tls.Tls_Config;    max_connections := 8;    active_exchanges: int;// milliseconds; zero means no transport write timeout    write_timeout: s64;    client: Client;}

A scheduler-bound, HTTP/2-only connection scope. Keep it and its TLS config alive until all exchanges and close_http2_channel have completed.

Example
channel: Http2_Channel;
channel.base_url = "https://example.com";

assert(channel.max_connections == 8);
assert(channel.active_exchanges == 0);

See also