qbit-rpc
    Preparing search index...

    Type Alias ZmqEvent

    ZmqEvent:
        | { kind: "message"; message: ZmqMessage; receivedAt: number }
        | { kind: "gap" } & SequenceGap
        | { error: ZmqFrameError; kind: "malformed" }
        | {
            attempt: number;
            code?: ZmqReconnectCode;
            kind: "reconnect";
            reason: "disconnected" | "failed";
        }

    What the subscriber yields.

    Type Declaration

    • { kind: "message"; message: ZmqMessage; receivedAt: number }
      • Readonlykind: "message"

        A message, parsed.

      • Readonlymessage: ZmqMessage

        The message.

      • ReadonlyreceivedAt: number

        Local receipt time (Date.now()), not a node timestamp: a wall-clock time for display. health() measures age on the monotonic clock.

    • { kind: "gap" } & SequenceGap
      • Readonlykind: "gap"

        A topic's counter broke: messages were lost, or the publisher restarted. Reconcile over RPC.

    • { error: ZmqFrameError; kind: "malformed" }
      • Readonlyerror: ZmqFrameError

        Why it does not parse.

      • Readonlykind: "malformed"

        A message that does not parse; the subscriber goes on to the next.

    • {
          attempt: number;
          code?: ZmqReconnectCode;
          kind: "reconnect";
          reason: "disconnected" | "failed";
      }
      • Readonlyattempt: number

        How many times this iteration has replaced the socket, this time included.

      • Optional Readonlycode?: ZmqReconnectCode

        For failed, the code of the error the socket call failed with, when it had one.

      • Readonlykind: "reconnect"

        The socket was replaced; messages published meanwhile are lost.

      • Readonlyreason: "disconnected" | "failed"

        disconnected: a connection to the publisher dropped after its handshake: qbitd stopped or restarted, sent a message over maxMessageSize, or missed a heartbeat, which also happens when the consumer falls behind long enough to fill the receive queue. failed: no connection was made (qbitd down, the host name did not resolve, or no handshake within the deadline), or making, connecting or receiving on the socket failed, other than with a ZmqSetupError.