Skip to content

scoped execution#157

Draft
wyvernbw wants to merge 3 commits intosmol-rs:masterfrom
wyvernbw:scoped
Draft

scoped execution#157
wyvernbw wants to merge 3 commits intosmol-rs:masterfrom
wyvernbw:scoped

Conversation

@wyvernbw
Copy link

@wyvernbw wyvernbw commented Jan 12, 2026

This implements an MVP scope function for Executor that allows spawning tasks in a scope, guaranteeing they complete by the time the scope ends (not quite, as it returns a future that needs to be awaited and that borrows from the executor). This is similar to crates like async-scoped or std's std::thread::scope.

This allows referencing local data in spawned tasks.

TODO:

  • 1. fix any possible soundness holes
  • 2. use a better joining method
  • 3. documentation

I'm willing to finish this but I would need some input for no. 1 and 2 because im not an expert and i dont want to spend time making a nicely packaged PR that is fundamentally wrong :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant