Skip to content

Run some services concurrently#196

Merged
einarmo merged 1 commit intomasterfrom
parallel-services
Jan 30, 2026
Merged

Run some services concurrently#196
einarmo merged 1 commit intomasterfrom
parallel-services

Conversation

@einarmo
Copy link
Contributor

@einarmo einarmo commented Jan 28, 2026

I've had this lying around for some time, and figured I'd finish it up. It's on the todo list.

This implements a general way to run some of our services concurrently, notably just the ones that are supposed to be run on one node manager specifically, like Read and Write.

This involved some slightly fiddly async code, but the result isn't too bad, and allows us to generalize a few things that we're not very consistent about, like setting current_node_manager_index between calls.

Doing this properly required cloning the RequestContext. I'm concerned about the cost of this clone, which up until now we've been pretty lazy about, so I moved the shared part into an inner field behind an Arc. To avoid this breaking every server implementation I added a Deref<RequestContextInner> to RequestContext which is a bad practice, but does seem alright in this case. The alternative is to make the fields non-public and expose getters, but then every node manager implementation will have a hundred breaking changes.

@svanharmelen
Copy link
Contributor

Guess this needs a rebase when PR #195 is merged.

@einarmo
Copy link
Contributor Author

einarmo commented Jan 30, 2026

Yep. It seems like the same list of clippy lints.

This implements a general way to run some of our services concurrently,
notably _just_ the ones that are supposed to be run on one node manager
specifically, like `Read` and `Write`.

This involved some slightly fiddly async code, but the result isn't too
bad, and allows us to generalize a few things that we're not very
consistent about, like setting `current_node_manager_index` between
calls.

Doing this properly required cloning the `RequestContext`. I'm concerned
about the cost of this clone, which up until now we've been pretty lazy
about, so I moved the shared part into an `inner` field behind an `Arc`.
To avoid this breaking every server implementation I added a
`Deref<RequestContextInner>` to `RequestContext` which is a bad
practice, but does seem alright in this case.
@einarmo einarmo merged commit 0f682c8 into master Jan 30, 2026
6 checks passed
@einarmo einarmo deleted the parallel-services branch January 30, 2026 10:26
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