Skip to content

Broadcast lobby list changes #12

@elementbound

Description

@elementbound

Background

Clients should be able to follow list updates in real-time, as they happen, instead of having to poll regularly.

Done criteria

  1. Lobby event bus is implemented
    1. An event bus singleton is created for the lobby module
    2. Lobby module publishes an event whenever a lobby is:
      1. Created
      2. Hidden
      3. Locked
      4. Has its custom data changed
      5. Removed
  2. lobby/list/subscribe command handler is implemented
    1. Command must be a request
    2. Adds sender to list of subscribers if not already on it
    3. Stream all currently visible lobby IDs in response
  3. lobby/list/unsubscribe command handler is implemented
    1. Removes sender from list of subscribers if already on it
  4. Broadcast events to subscribers
    1. Send a lobby/event/create command with ID when a lobby is created ( as visible ), or published
    2. Send a lobby/event/change command with ID when a lobby is locked, unlocked, or its custom data was changed
    3. Send a lobby/event/remove command with ID when a lobby is deleted or hidden

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

No one assigned

    Labels

    featNew feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions