TinyBase logoTinyBase

Receive

The Receive type describes a function that knows how to handle the arrival of a message as part of the synchronization protocol.

(
  fromClientId: Id,
  requestId: IdOrNull,
  message: Message,
  body: any,
): void
TypeDescription
fromClientIdId

The Id of the other client (in other words, the other system) that sent the message.

requestIdIdOrNull

The optional Id of the message, which should be returned in the response (if requested) to constitute a matched request/response transaction.

messageMessage

A number that indicates the type of the message, according to the Message enum.

bodyany

A message-specific payload.

returnsvoid

This has no return value.

When a message arrives (most likely from another system), the function will be called with parameters that indicate where the message came from, and its meaning and content.

Since

v5.0.0