Skip to content

Register tasks in DurableBuilder rather than Durable client#77

Merged
virajmehta merged 1 commit intomainfrom
aaron/static-registration
Mar 11, 2026
Merged

Register tasks in DurableBuilder rather than Durable client#77
virajmehta merged 1 commit intomainfrom
aaron/static-registration

Conversation

@Aaron1011
Copy link
Member

@Aaron1011 Aaron1011 commented Mar 5, 2026

This enforces that no new tasks can be registered once a Durable client has been constructed. As a result, we can avoid using an RwLock around the TaskRegistry


Note

Medium Risk
This is an API-breaking change that moves task registration to client construction and alters core worker spawn/dispatch paths by removing the registry RwLock. Risk is moderate because it touches the primary client/worker lifecycle, though behavior is mostly a structural refactor.

Overview
Task registration is moved from Durable to DurableBuilder. The async Durable::register* APIs are removed; tasks are now added via DurableBuilder::register/register_instance before build/build_with_state, and spawn_by_name_with validates against this immutable registry.

Runtime registry access is simplified and lock-free. Durable now holds an Arc<TaskRegistry> (no RwLock), and worker handler lookup uses direct registry reads. All benches and tests are updated to construct clients/builders with pre-registered tasks (including new BenchContext::with_builder / new_builder patterns).

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

This enforces that no new tasks can be registered once a Durable
client has been constructed. As a result, we can avoid using
an RwLock around the TaskRegistry
@Aaron1011 Aaron1011 force-pushed the aaron/static-registration branch from 4625bec to 03b5356 Compare March 9, 2026 13:42
@virajmehta virajmehta added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit 36245d1 Mar 11, 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.

2 participants