Esc

take_message

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

Transfers a complete payload to the caller and starts the next envelope. Returns empty if no message is ready; inspect ready before calling to distinguish that case from a legitimate zero-byte message.

Signature

take_message :: (decoder: *Envelope_Decoder) -> [] u8
Example
if decoder.ready { bytes := take_message(*decoder); defer free(bytes.data); }

See also