Skip to content

Flags

const Flags: object

Defined in: packages/protocol/src/wire-format.ts:72

Flag bits for the flags byte.

IMPORTANT: These flags are used in BINARY protocol for DATA PLANE. This is NOT JSON-RPC. This is raw binary for performance.

Layout:

bit 0: DIRECTION_TO_PARENT (0 = to child, 1 = to parent)
bit 1: IS_RESPONSE (0 = request/event, 1 = response)
bit 2: IS_ERROR (0 = ok, 1 = error)
bit 3: IS_STREAM (0 = single, 1 = stream chunk)
bit 4: STREAM_END (0 = more coming, 1 = final chunk)
bit 5: IS_ACK (0 = full response, 1 = ack only)
bit 6-7: reserved (must be 0)

readonly DIRECTION_TO_PARENT: 1 = 0b00000001

Message direction: 0 = to child, 1 = to parent

readonly IS_ACK: 32 = 0b00100000

Is this just an ACK (not full response)?

readonly IS_ERROR: 4 = 0b00000100

Is this an error response?

readonly IS_RESPONSE: 2 = 0b00000010

Is this a response? 0 = request/event, 1 = response

readonly IS_STREAM: 8 = 0b00001000

Is this a stream chunk?

readonly STREAM_END: 16 = 0b00010000

Is this the final stream chunk?