@procwire/protocol
@procwire/protocol - Binary wire format for Procwire data plane.
This package provides the binary protocol for the data plane. Control plane uses JSON-RPC (separate package). Data plane uses THIS binary protocol for ~80x better performance.
Example
Section titled “Example”import { encodeHeader, decodeHeader, createFlags, hasFlag, Flags, HEADER_SIZE,} from '@procwire/protocol';
// Encode a request headerconst header = encodeHeader({ methodId: 1, flags: createFlags({ toParent: false }), requestId: 42, payloadLength: 1024,});
// Decode received headerconst decoded = decodeHeader(buffer);if (hasFlag(decoded.flags, Flags.IS_STREAM)) { // handle stream chunk}Classes
Section titled “Classes”Interfaces
Section titled “Interfaces”Variables
Section titled “Variables”- ABORT_METHOD_ID
- ABSOLUTE_MAX_PAYLOAD_SIZE
- DEFAULT_MAX_PAYLOAD_SIZE
- Flags
- HEADER_POOL_SIZE
- HEADER_SIZE