Number of invalidation events currently retained in the circular ring buffer.
Latest monotonic sequence number assigned to a cache invalidation event in this process.
Maximum number of invalidation events held in the circular ring buffer.
Unique identifier of the running MJServer process, emitted in X-MJ-Server-ID.
Identifier for the active broadcast topology.
Configures the provider instance with buffer sizing, entity exclusions, and cloud settings.
Optionalconfig: CacheBroadcastProviderConfigEvaluates whether user has entity-level read permission for payload, memoized by
(payload, entityName, roleFingerprint) so $N$ subscribers sharing $R$ role combinations
only run GetUserPermisions $R$ times per event.
OptionalentityLookup: (entityName: string) => EntityInfoComputes the fully-qualified GCP Pub/Sub topic names for a user's roles.
Returns all permission-allowed, RLS-shaped invalidation events strictly after sinceSequence
for user. If sinceSequence has already been evicted from the ring buffer (or lies in the
future due to a server restart), sets RequiresFullRefresh: true and returns an empty Events list.
Computes a canonical, order-independent role fingerprint for a user (RoleHolder).
Memoized per user object in a WeakMap so repeated evaluations across thousands of events are $O(1)$.
Negotiates a client broadcast connection (URL, token, and authorized role-bucket groups) for the given authenticated user.
ProtectedOnHook invoked after an invalidation event is sequenced and stored in the ring buffer. Cloud multiplexer providers override this to forward role-bucketed payloads to their external pub/sub infrastructure.
Evaluates whether every read permission the user holds on entity is gated by a
Row-Level Security filter (ReadRLSFilterID).
Assigns the next monotonic sequence number to payload (if not already stamped on this server),
appends it to the bounded circular ring buffer, and invokes OnInvalidationRecorded for
provider-specific fan-out.
Resets the sequence counter and ring buffer. Intended for unit tests.
Resolves and caches the EntityInfo for a CacheInvalidationPayload so that
CacheInvalidationFilter and CacheInvalidationResolver do not repeat metadata lookups.
OptionalentityLookup: (entityName: string) => EntityInfoInstalls a custom Google Cloud Pub/Sub topic publisher (e.g., @google-cloud/pubsub adapter or test spy).
Shapes a CacheInvalidationPayload into a CacheInvalidationNotification for user and entity.
When user and entity are present and user.UserRoles is populated, the shaped object is
memoized per (payload, entity, roleFingerprint) so $N$ subscribers sharing $R$ role buckets
only allocate and evaluate ReadIsRowFiltered $R$ times per event.
Returns whether invalidation events for entityName should be broadcast to clients.
Returns false for blank names or entities explicitly listed in excludedEntities.
Topology 3 Cloud Multiplexer Provider for Google Cloud Pub/Sub + Cloud Run WebSockets (
'GCPPubSub').Offloads per-client WebSocket connection management and message fan-out from MJServer to a Google Cloud Pub/Sub + Cloud Run WebSocket fan-out gateway:
NegotiateCacheBroadcastConnectionto obtain a signed gateway token and its authorized Pub/Sub role subscription attributes (projects/<projectId>/topics/<topicPrefix>-role-<RoleID>).