The Redis arm's options
This instance's identity
The Redis channel every instance shares
Optionalreporter: IRealtimeHandlerErrorReporter
Optional subscriber failure and recovery sink; history is always retained
OptionalisM70c: present only when both connections expose status and ping; the
indicator reads absence as unknown (a minimal fake that lacks the
surface has not told us the backend is dead). A subscriber-mode connection
refuses every command but (un)subscribe, so the pair is probed separately
(M47's two-connection requirement).
ReadonlyoriginThis instance's identity, stamped onto every frame it publishes.
Stable for the lifetime of the instance and distinct from every peer's.
The most recent 100 errors thrown by subscribers during delivery, oldest first.
Leaves the topic and closes both connections. Every step is attempted even
when an earlier one fails; a connection whose QUIT fails is force-closed
through disconnect() when the client has one.
Builds the client pair when needed, then subscribes.
Idempotent and safe to call concurrently: the open is memoized, so two
overlapping calls join one attempt rather than each building — and leaking —
its own pair of connections. A failed attempt leaves the instance
unconnected with any connection it created already quit, and clears the memo
so a later call retries. A close() arriving mid-attempt wins: the attempt
retires whatever it built rather than publishing it.
Publishes a frame to every other subscribed instance.
The frame is not delivered back to this instance's own handlers — a local broadcast has already reached local members directly, and redelivering it would double-send.
The frame to publish
Registers a handler for frames arriving from other instances.
May be called more than once; each consumer plugin registers its own.
Invoked per arriving frame
A function that removes this handler
Carries frames over Redis pub/sub.
Two connections, deliberately. A Redis connection in subscriber mode refuses every command other than (un)subscribe, so publishing over the subscribed connection fails at runtime. That is a property of the Redis protocol rather than of
ioredis, and it is invisible to any test driven with a single fake — hence the constructor refuses an injected client that arrives without its subscriber.Example
Since
0.2.0