goodboy / tractor

A distributed, structured concurrent runtime for Python (and friends)
GNU Affero General Public License v3.0
267 stars 12 forks source link

Reliable stream termination can be solved by tracking streams per portal, per nursery? #87

Open goodboy opened 5 years ago

goodboy commented 5 years ago

As per #57 we need a system to help manage stream teardown, namely the explicit calling of StreamReceiveChannel.aclose() on either intentional stream termination by a consumer/producer or by the containing ActorNursery during its wait on all actors to complete or error phase.

what we've got right now:

That last suggestion needs some thought; task-actor interaction in terms of how portals can be passed around between task versus actor nurseries is not clear to me yet.

goodboy commented 5 years ago

Actually hold up, if a push producer (using Context) exits its decorated function the client should be signalled that the stream stopped - which results in the local results channel being closed and thus subsequently in the IPC channel being cancelled.