Skip to content

We need broadcast channels, stat. #204

@goodboy

Description

@goodboy

This ties in with #40 and #53 both of which heavily rely on the discussion in python-trio/trio#987.

The main gotcha is that trio's mem chans don't have broadcasting built-in (frankly making them mostly an SC anti-pattern if you have followed the .clone() semantics discussion). This mis-assumption was what originally fueled #203.

The obvious main use case is for broadcasting stream data on the receive side of a stream such that multiple rx-side tasks get each their own copy of a new message. NB: We already have a prototype for producer side ala tractor.msg.pub, though I'm not sure it's the best solution either.

Depending on how we move forward with bidirectional-streaming in #53 it might be worth offering a .clone() or similar method which provides a broadcast reference token to consumer tasks.

Definitely needs a deeper dive.

For reference here's the current short list of broadcast chan impls:

Any more implementations are greatly welcome from the lurker pack 😉

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions