Esc

received_compressed

procedureextensionsince 0.36.1Source
  • macOS: received_compressed works on macOS
  • Linux: received_compressed works on Linux
  • Windows: received_compressed works on Windows
  • Wasm: received_compressed works on Wasm

Whether the last MESSAGE received used the negotiated compressed envelope. This describes wire compression, independently of the decoded Protobuf value. .

Signature

received_compressed :: (call: *Call) -> bool
Example
channel: Channel; // set transport.base_url and transport.tls before the first call
method := Method.{ path = "/echo.Echo/Say" };
call, status := open_call(*channel, method);
assert(status.code == .OK);
defer close(*call);
message, kind := receive_bytes(*call);
if kind == .MESSAGE {
    defer free(message.data);
    print("gzip: %\n", received_compressed(*call));
}

See also