Skip to content

Conversation

@virajmehta
Copy link
Member

@virajmehta virajmehta commented Jan 19, 2026

This will allow us to stick parameterized info into tasks so that we can e.g. execute code in a scripting language loaded at runtime.


Note

Modernizes task API to be instance-based and enables dynamic registration.

  • Change Task trait to use instance methods: name(&self) and run(&self, ...)
  • Replace registry entries with Arc<dyn ErasedTask> via new TaskWrapper; worker clones handlers from registry
  • Client updates: register<T: Task + Default>() now registers a default instance; add register_instance<T: Task>; type-safe spawn* now require Default and use the instance name()
  • TaskContext::spawn<T> now requires Default and uses instance name(); telemetry field cleanup
  • Public exports include ErasedTask and TaskWrapper; docs, benches, and tests updated with #[derive(Default)] tasks

Written by Cursor Bugbot for commit d4e9ba6. This will update automatically on new commits. Configure here.

@virajmehta virajmehta changed the title changed interface to use instance mthods rather than static ones changed interface to use instance methods rather than static ones Jan 19, 2026
@virajmehta virajmehta requested a review from Aaron1011 January 19, 2026 18:49
@virajmehta virajmehta marked this pull request as ready for review January 20, 2026 16:12
@virajmehta virajmehta added this pull request to the merge queue Jan 20, 2026
Merged via the queue into main with commit 851d60d Jan 20, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants