-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
featNew featureNew feature
Description
Background
Clients should be able to follow list updates in real-time, as they happen, instead of having to poll regularly.
Done criteria
- Lobby event bus is implemented
- An event bus singleton is created for the lobby module
- Lobby module publishes an event whenever a lobby is:
- Created
- Hidden
- Locked
- Has its custom data changed
- Removed
lobby/list/subscribecommand handler is implemented- Command must be a request
- Adds sender to list of subscribers if not already on it
- Stream all currently visible lobby IDs in response
lobby/list/unsubscribecommand handler is implemented- Removes sender from list of subscribers if already on it
- Broadcast events to subscribers
- Send a
lobby/event/createcommand with ID when a lobby is created ( as visible ), or published - Send a
lobby/event/changecommand with ID when a lobby is locked, unlocked, or its custom data was changed - Send a
lobby/event/removecommand with ID when a lobby is deleted or hidden
- Send a
Notes
- Events only contain a lobby ID, clients can query further lobby data when they receive an event
- Buffering events is not necessary for now, we can implement that later
Example:
> lobby/list/subscribe?0123
< |0123 abcd
< |0123 efgh
< |0123
# some time passes
< lobby/event/create ijklm
< lobby/event/remove efgh
< lobby/event/change abcd
Metadata
Metadata
Assignees
Labels
featNew featureNew feature