Skip to main content

Module envelope

Module envelope 

Source
Expand description

Protocol envelope writer.

Every afhttp command emits one structured value per invocation: a single line of JSON, wrapped with a top-level code field ("fetch", "health", "error", etc.) and a trailing newline. JSON is the only output format โ€” one request in, one line of structured JSON out.

Functionsยง

emit
Emit a single envelope payload to writer. The payload is wrapped with a top-level code field and written as one line of JSON followed by a newline.
emit_error
Convenience: emit an Error value with code: "error".