This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Description
Motivation
Add ability to broadcast to conns except for the conn that sent the RPC request. Only available on ActionContext.
Implementation
actor({
actions: {
foo: c => {
c.broadcast("bar", 123, { excludeSelf: true });
}
}
});
excludeSelf naming could use some work.
Alternative Implementations
exclude
Add a more generic option for just excluding connection IDs.
actor({
actions: {
foo: c => {
c.broadcast("bar", 123, { exclude: [c.conn.id] });
}
}
});
It might make sense to implement both, since broadcast to all but self is a very common operation.
broadcastToOthers
Same functionality as excludeSelf but a separate method name.
Prior Art
Socket.io:
io.except(excludedSocketId).emit('broadcastEvent', data);