Expand description
interface WxMessage {
d: unknown;
f: number;
m: number;
p: string;
s: "workex";
}Properties§
d: unknownData payload.
This is anything transferrable by the underlying messaging channel. For example, for Workers, this is any transferreable object. For web requests, this should probably be something seraializable to JSON.
f: numberFunction identifier.
This is a unique identifier inside the protocol that identifies the function that is being called by RPC. For response messages, this indicates if the response is a return (0) or catch (1)
Functions 0-31 are reserved for internal use in workex library
m: numberMessage identifier.
This is a serial number generated per RPC call to route the returned response to the promise that is waiting for it.
Messages 0-99 are reserved for internal use. Regular RPC calls will start from 100. Note that the first few messages are used to register the buses
p: stringThe protocol identifier. Listeners on the other side maybe use this identifier to choose if they should handle or ignore the payload
The protocol "workex" is reserved for internal communication
s: "workex"
Message object with the
sfield set to "workex" to not be confused with messages with other libraries