Split out deferred and tokio_runtime to their own Rust modules#19868
Merged
MadLittleMods merged 5 commits intoJun 20, 2026
Conversation
MadLittleMods
commented
Jun 19, 2026
| @@ -0,0 +1,140 @@ | |||
| /* | |||
Contributor
Author
There was a problem hiding this comment.
This is just a case of copy-pasting stuff from rust/src/http_client.rs
MadLittleMods
commented
Jun 19, 2026
Comment on lines
+132
to
+140
| /// Called when registering modules with python. | ||
| pub fn register_module(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { | ||
| _ = m; | ||
|
|
||
| // Make sure we fail early if we can't load some modules | ||
| defer(py)?; | ||
|
|
||
| Ok(()) | ||
| } |
Contributor
Author
There was a problem hiding this comment.
The register_module(...) is new but the functionality is pulled from the register_module(...) from rust/src/http_client.rs
MadLittleMods
commented
Jun 19, 2026
| @@ -0,0 +1,107 @@ | |||
| /* | |||
Contributor
Author
There was a problem hiding this comment.
This is just a case of copy-pasting stuff from rust/src/http_client.rs
erikjohnston
approved these changes
Jun 19, 2026
sandhose
reviewed
Jun 19, 2026
| use crate::tokio_runtime::runtime; | ||
|
|
||
| create_exception!( | ||
| synapse.synapse_rust.http_client, |
Member
There was a problem hiding this comment.
I think it's a bit weird to have the exception registered at this place in the module tree
Contributor
Author
There was a problem hiding this comment.
🤷 We only use it here so far. Seems at-least as good as before ⏩
Can update in a follow-up PR if you have a suggestion
deferred and tokio_runtime to their own Rust cratesdeferred and tokio_runtime to their own Rust modules
Contributor
Author
|
Thanks for the review @erikjohnston and @sandhose 🐜 |
7 tasks
This file contains hidden or 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
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.
Split out
deferredandtokio_runtimeto their own Rust modulesSpawning from #19824 / #19846 and wanting to use
create_deferredin more than just thehttp_client.rsPull Request Checklist
EventStoretoEventWorkerStore.".code blocks.