Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creating tasks that automatically cancel when a nursery exits #70

Open
lordmauve opened this issue Sep 27, 2021 · 0 comments
Open

Comments

@lordmauve
Copy link
Owner

When writing Axium it became apparent that service tasks would be extremely helpful.

This is the same idea mentioned in the Trio tracker: python-trio/trio#1521

For Axium these tasks might often be effects that update only as long as the nursery is alive:

async with w2d.Nursery() as ns:
    ns.do(drive_ship(ship))
    ns.run_service(effects.trail(ship))

So if drive_ship() exits the trail is automatically cancelled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant