Skip to content

Extract worker_api from restate-core into restate-worker-api crate#4630

Merged
AhmedSoliman merged 2 commits into
mainfrom
pr4630
Apr 22, 2026
Merged

Extract worker_api from restate-core into restate-worker-api crate#4630
AhmedSoliman merged 2 commits into
mainfrom
pr4630

Conversation

@AhmedSoliman
Copy link
Copy Markdown
Contributor

@AhmedSoliman AhmedSoliman commented Apr 22, 2026

Move the worker_api module out of restate-core into its own dedicated
crate to reduce coupling and improve modularity. The new restate-worker-api
crate contains ProcessorsManagerHandle, ProcessorsManagerCommand, and
PartitionProcessorInvocationClient with all associated error types.

As part of the extraction, replaced assert2::let_assert! with idiomatic
let...else patterns, removing the assert2 dependency from the new crate.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com


Stack created with Sapling. Best reviewed with ReviewStack.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 369421bbd8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +78 to +82
impl<K, V, S> NetSerde for HashMap<K, V, S>
where
K: NetSerde,
V: NetSerde,
{
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore NetSerde support for std::collections::HashMap

NetSerde is now implemented for crate::hash::HashMap (hashbrown) instead of std::collections::HashMap, which narrows supported field types compared to the previous implementation in restate-encoding. Any #[derive(NetSerde)] type that still uses std::collections::HashMap will fail trait bounds after this change, and this refactor’s test updates already had to switch map imports to compensate. Keeping an impl for the standard map type preserves existing NetSerde behavior and avoids forcing unrelated type migrations.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a future PR, std::collections::HashMap will be banned by clippy, currently NetSerde's use of hashmap is only needed for a test-case which I've refactored.

@github-actions
Copy link
Copy Markdown

Test Results

 5 files   -   3   5 suites   - 3   2m 12s ⏱️ - 3m 3s
43 tests  -  10  43 ✅  -  10  0 💤 ±0  0 ❌ ±0 
70 runs   - 163  70 ✅  - 163  0 💤 ±0  0 ❌ ±0 

Results for commit 2c990df. ± Comparison against base commit a4c8893.

This pull request removes 51 and adds 41 tests. Note that renamed tests count towards both.
dev.restate.sdktesting.tests.CallOrdering ‑ ordering(boolean[], Client)[1]
dev.restate.sdktesting.tests.CallOrdering ‑ ordering(boolean[], Client)[2]
dev.restate.sdktesting.tests.CallOrdering ‑ ordering(boolean[], Client)[3]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromAdminAPI(BlockingOperation, Client, URI)[1]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromAdminAPI(BlockingOperation, Client, URI)[2]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromAdminAPI(BlockingOperation, Client, URI)[3]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromContext(BlockingOperation, Client)[1]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromContext(BlockingOperation, Client)[2]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromContext(BlockingOperation, Client)[3]
dev.restate.sdktesting.tests.Combinators ‑ awakeableOrTimeoutUsingAwaitAny(Client)
…
dev.restate.sdktesting.tests.AwakeableIngressEndpointTest ‑ completeWithFailure(Client)
dev.restate.sdktesting.tests.AwakeableIngressEndpointTest ‑ completeWithSuccess(Client)
dev.restate.sdktesting.tests.AwakeableLeaderTransferTest ‑ awakeableCompletionsAreNotLostDuringLeaderTransfer(Client, ContainerHandle)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ completeAwakeable(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ completeRetryableOperation(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ proxyCallShouldBeDone(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ proxyOneWayCallShouldBeDone(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$OldVersion ‑ createAwakeable(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$OldVersion ‑ startOneWayProxyCall(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$OldVersion ‑ startProxyCall(Client)
…

@github-actions
Copy link
Copy Markdown

Test Results

 5 files   -   3   5 suites   - 3   2m 1s ⏱️ - 3m 14s
35 tests  -  18  35 ✅  -  18  0 💤 ±0  0 ❌ ±0 
62 runs   - 171  62 ✅  - 171  0 💤 ±0  0 ❌ ±0 

Results for commit 2c990df. ± Comparison against base commit a4c8893.

This pull request removes 51 and adds 33 tests. Note that renamed tests count towards both.
dev.restate.sdktesting.tests.CallOrdering ‑ ordering(boolean[], Client)[1]
dev.restate.sdktesting.tests.CallOrdering ‑ ordering(boolean[], Client)[2]
dev.restate.sdktesting.tests.CallOrdering ‑ ordering(boolean[], Client)[3]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromAdminAPI(BlockingOperation, Client, URI)[1]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromAdminAPI(BlockingOperation, Client, URI)[2]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromAdminAPI(BlockingOperation, Client, URI)[3]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromContext(BlockingOperation, Client)[1]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromContext(BlockingOperation, Client)[2]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromContext(BlockingOperation, Client)[3]
dev.restate.sdktesting.tests.Combinators ‑ awakeableOrTimeoutUsingAwaitAny(Client)
…
dev.restate.sdktesting.tests.AwakeableIngressEndpointTest ‑ completeWithFailure(Client)
dev.restate.sdktesting.tests.AwakeableIngressEndpointTest ‑ completeWithSuccess(Client)
dev.restate.sdktesting.tests.AwakeableLeaderTransferTest ‑ awakeableCompletionsAreNotLostDuringLeaderTransfer(Client, ContainerHandle)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ completeAwakeable(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ completeRetryableOperation(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ proxyCallShouldBeDone(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ proxyOneWayCallShouldBeDone(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$OldVersion ‑ createAwakeable(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$OldVersion ‑ startOneWayProxyCall(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$OldVersion ‑ startProxyCall(Client)
…

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

Test Results

 5 files   -   2   5 suites   - 2   2m 3s ⏱️ -43s
35 tests  -  12  35 ✅  -  12  0 💤 ±0  0 ❌ ±0 
62 runs   - 138  62 ✅  - 138  0 💤 ±0  0 ❌ ±0 

Results for commit 1333dfe. ± Comparison against base commit a4c8893.

This pull request removes 45 and adds 33 tests. Note that renamed tests count towards both.
dev.restate.sdktesting.tests.CallOrdering ‑ ordering(boolean[], Client)[1]
dev.restate.sdktesting.tests.CallOrdering ‑ ordering(boolean[], Client)[2]
dev.restate.sdktesting.tests.CallOrdering ‑ ordering(boolean[], Client)[3]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromAdminAPI(BlockingOperation, Client, URI)[1]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromAdminAPI(BlockingOperation, Client, URI)[2]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromAdminAPI(BlockingOperation, Client, URI)[3]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromContext(BlockingOperation, Client)[1]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromContext(BlockingOperation, Client)[2]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromContext(BlockingOperation, Client)[3]
dev.restate.sdktesting.tests.Combinators ‑ awakeableOrTimeoutUsingAwakeableTimeoutCommand(Client)
…
dev.restate.sdktesting.tests.AwakeableIngressEndpointTest ‑ completeWithFailure(Client)
dev.restate.sdktesting.tests.AwakeableIngressEndpointTest ‑ completeWithSuccess(Client)
dev.restate.sdktesting.tests.AwakeableLeaderTransferTest ‑ awakeableCompletionsAreNotLostDuringLeaderTransfer(Client, ContainerHandle)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ completeAwakeable(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ completeRetryableOperation(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ proxyCallShouldBeDone(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ proxyOneWayCallShouldBeDone(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$OldVersion ‑ createAwakeable(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$OldVersion ‑ startOneWayProxyCall(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$OldVersion ‑ startProxyCall(Client)
…

♻️ This comment has been updated with latest results.

AhmedSoliman and others added 2 commits April 22, 2026 15:40
Part of the effort to decompose the restate-types monolith into focused,
composable utility crates.

Add `restate-platform` as a low-dependency foundation crate that provides
key type aliases, traits, and essential types the rest of the project can
reliably depend upon. It sits at the bottom of the dependency graph with
minimal transitive dependencies.

Moves the following into restate-platform:
- Error traits (GenericError, CodedError) from restate-types
- Storage traits (StorageEncode, StorageDecode) from restate-types
- Network marker trait (NetSerde) from restate-encoding
- Memory estimation trait (EstimatedMemorySize) from restate-memory
- Hash re-exports (HashMap, HashSet) for consistent hashing
- Sync utilities (OwnedSemaphorePermit)
Move the worker_api module out of restate-core into its own dedicated
crate to reduce coupling and improve modularity. The new restate-worker-api
crate contains ProcessorsManagerHandle, ProcessorsManagerCommand, and
PartitionProcessorInvocationClient with all associated error types.

As part of the extraction, replaced assert2::let_assert! with idiomatic
let...else patterns, removing the assert2 dependency from the new crate.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@AhmedSoliman AhmedSoliman merged commit cc25558 into main Apr 22, 2026
40 checks passed
@AhmedSoliman AhmedSoliman deleted the pr4630 branch April 22, 2026 14:52
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant