Skip to content

Commit

Permalink
Merge pull request #229 from goodboy/live_on_air_from_tokio
Browse files Browse the repository at this point in the history
`tokio`-style broadcast channels
  • Loading branch information
goodboy authored Sep 3, 2021
2 parents 87ce6c8 + 1137a9e commit 3f1bc37
Show file tree
Hide file tree
Showing 6 changed files with 842 additions and 14 deletions.
12 changes: 12 additions & 0 deletions newsfragments/229.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Add `tokio-style broadcast channels
<https://docs.rs/tokio/1.11.0/tokio/sync/broadcast/index.html>`_ as
a solution for `#204 <https://github.com/goodboy/tractor/pull/204>`_ and
discussed thoroughly in `trio/#987
<https://github.com/python-trio/trio/issues/987>`_.

This gives us local task broadcast functionality using a new
``BroadcastReceiver`` type which can wrap ``trio.ReceiveChannel`` and
provide fan-out copies of a stream of data to every subscribed consumer.
We use this new machinery to provide a ``ReceiveMsgStream.subscribe()``
async context manager which can be used by actor-local concumers tasks
to easily pull from a shared and dynamic IPC stream.
Loading

0 comments on commit 3f1bc37

Please sign in to comment.