Skip to content

Commit

Permalink
Wrap sends in a separate nursery
Browse files Browse the repository at this point in the history
  • Loading branch information
andersea committed Jan 26, 2024
1 parent 9d862bb commit 7270155
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions slurry/_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ async def _pump(self):
if not self._taps:
# Hmm.. Debatable. Should closing all taps close the pipeline?
break
for tap in self._taps:
nursery.start_soon(tap.send, item)
async with trio.open_nursery() as send_nursery:
for tap in self._taps:
send_nursery.start_soon(tap.send, item)

# There is no more output to send. Close the taps.
for tap in self._taps:
Expand Down

0 comments on commit 7270155

Please sign in to comment.