tractor
tractor copied to clipboard
Enhance the portal (close) API?
I ran into problems trying to get channels to reliably tear down using StreamSocket.aclose() as per python-trio/trio/pull/460.
@njsmith was very helpful in pointing out that until this is resolved streams need to be cancelled using a separate scope / task which is what I ended up doing with open_portal() but I feel like this can be made even fancier according to his answer on SO.
Definitely worth toying with.
Also @nonsleepr on July 6, 2018 10:30 AM came up with an example that might not require the extra nursery.
python-trio/trio#460 Is in so we can toy with dropping the extra nursery that was added to work around the underlying issue.
This probably also ties into #206.