Skip to content

Events · Modules

3 modules · 6 exports · 0 repositories · 0 e2e tests · 2 routes

Who imports who · hover a node
Depends onEvents modulesUsed byEventBus.server2 exportsSseConnections.serverTopicAccess.server1 exp…Routes3 filesVoicePresence.servervo…Other1 file

EventBus

serverapp/features/events/core/EventBus.server.ts

No overview comment at the top of the file.

Imports
no other modules
Used by
2 routes1 module1 other

Functions & values

function

subscribe

:26

Yields the channels' events until the signal aborts (pending events dropped) or the consumer stops iterating.

export function subscribe(
	channels: string[],
	signal: AbortSignal,
): AsyncIterable<ServerEvent>
Unit tests (5)
Routes/sse

Not shown, only used by tests: subscriberCount

SseConnections

serverapp/features/events/core/SseConnections.server.ts

No overview comment at the top of the file.

Imports
no other modules
Used by
2 routes

Functions & values

function

register

:9

Registers a live SSE connection so its topic set can be addressed by connection id.

export function register(connectionId: string, connection: SseConnection)
Routes/sse
function

unregister

:14

Removes a closed SSE connection from the registry.

export function unregister(connectionId: string)
Routes/sse
function

replaceTopics

:19

Replaces the connection's topic set wholesale. Returns false when the user has no live connection with the given id.

export function replaceTopics(
	connectionId: string,
	userId: number,
	topics: string[],
): boolean

TopicAccess

serverapp/features/events/core/TopicAccess.server.ts

No overview comment at the top of the file.

Imports
no other modules
Used by
1 route

Functions & values

function

canSubscribeToAll

:15

Whether the user may subscribe their SSE connection to every one of the topics. The user__ channel is never client-controllable.

export async function canSubscribeToAll(
	userId: number,
	topics: string[],
): Promise<boolean>
Unit tests (5)