Skip to content

Sync version of broadcast #1466

Open
Open
@Phlogistique

Description

@Phlogistique

The library includes a broadcast utility, with detailed documentation and motivation here.

However, today that utility only works with the asyncio API of WebSockets.

That leaves users of the sync API with two possibilities, if they want to broadcast a message without risk of blocking the thread if some client's buffer is full:

  • Implement broadcast by accessing directly the socket and the sans-IO API to set the sockets to be non-blocking during the broadcast. (tricky!)
  • Implement broadcast by the way of application-level queues, and per-client threads consuming from the queues (runtime and implementation overhead)

It would be nice if the sync API of this library included a ready-made broadcast utility.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions