-
Notifications
You must be signed in to change notification settings - Fork 37
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
[TaskCenter][4/n] Remove TaskCenter/Metadata references from Bifrost #2344
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Nov 21, 2024
AhmedSoliman
force-pushed
the
pr2344
branch
3 times, most recently
from
November 22, 2024 13:23
efacf8d
to
eb2d796
Compare
This was referenced Nov 22, 2024
AhmedSoliman
changed the title
[TaskCenter] Stage 4
[TaskCenter][4/n] Remove TaskCenter/Metadata references from Bifrost
Nov 25, 2024
tillrohrmann
approved these changes
Nov 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. +1 for merging. Looking forward to the macro that was teased in this chapter :-)
- Adds `in_tc(&TaskCenter)` and `in_current_tc()` to scope a future to run in a task-center if it'll be dispatched as a task - Introduces a root task (TaskId(0)) in TaskCenter that's used as a default parent/source of task context - Removes unnecessary args from block_on, run_in_scope_sync. (some of those will be changed in future PRs) - Introduces `Metadata::current()` and `Metadata::with_current(F)`
- Improvements to the future extensions (fixing root task context propagation) - A round of removals of explicit task-center reference passing - `try_set_global_metadata` is now an associated function ## Example Before: ```rust task_center().spawn_child( TaskKind::RpcServer, "metadata-store-grpc", None, async move { net_util::run_hyper_server( &bind_address, service, "metadata-store-grpc", || health_status.update(MetadataServerStatus::Ready), || health_status.update(MetadataServerStatus::Unknown), ) .await?; Ok(()) }, )?; ``` After: ```rust TaskCenter::spawn_child(TaskKind::RpcServer, "metadata-store-grpc", async move { net_util::run_hyper_server( &bind_address, service, "metadata-store-grpc", || health_status.update(MetadataServerStatus::Ready), || health_status.update(MetadataServerStatus::Unknown), ) .await?; Ok(()) })?; ```
Also, exercises `in_tc()` in some tests. Those will be swapped with `restate_core::test` in next PRs. Example of impact: ```rust let bifrost = node_env .tc .run_in_scope( "bifrost init", None, Bifrost::init_in_memory(node_env.metadata.clone()), ) .await; ``` Becomes: ```rust let bifrost = Bifrost::init_in_memory().in_tc(&node_env.tc).await; ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also, exercises
in_tc()
in some tests. Those will be swapped withrestate_core::test
in next PRs.Example of impact:
Becomes:
Stack created with Sapling. Best reviewed with ReviewStack.