-
Notifications
You must be signed in to change notification settings - Fork 26
feat: Add SpawnService
and SpawnedReqwestConnector
for running requests on a different runtime
#332
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
Conversation
5e37401
to
0b2ff8c
Compare
0b2ff8c
to
92ce4c3
Compare
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.
Thank you @ion-elgreco (and @tustvold ) -- this is great.
I think it would help a lot of we could add some more documentation / examples
Basically, imagine someone coming to https://docs.rs/object_store/latest/object_store/
- How would they find out about this feature / decide when to use it
- How would they be able to use it?
Perhaps we could
- Add a brief section after TLS Certificiates with a pointer to the src/client/http module
- Add some documentation examples in http with pointers to SpawnService
I can try and help with this documentation later this week
Example:
Is there any chance you can add this example somewhere?
FYI @kylebarron |
@alamb sure! I'll add more docs tomorrow |
@alamb I've added some docs |
Note due to #335 the CI was not running. I plan to merge up from main shortly |
SpawnService
and SpawnedReqwestConnector
for running requests on a different runtime
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.
Thank you @ion-elgreco 🙏
As I mentioned I spent a while longer today updating the docs and adding some more tests. I think this PR is now ready to rock. Thank you so much
This completes a feature we have been talking about / discussing for over a year. 💯 🦾 !
FYI @crepererum and @tustvold
|
||
/// Integration test that ensures I/O is done on an alternate threadpool | ||
/// when using the `SpawnedReqwestConnector`. | ||
#[test] |
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.
I also wrote this end to end integration test to ensure that everything worked correctly when hooked up to an ObjectStore implementation (and it does!)
|
||
// Runtime with I/O enabled | ||
let io_runtime = tokio::runtime::Builder::new_current_thread() | ||
.enable_all() // <-- turns on IO |
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.
if you comment out this line the test fails
I am out starting tomorrow for a week, so if another committer doesn't merge this before I will do so when I get back Thanks again @ion-elgreco |
This appears to have accumulated some merge conflicts |
I'll try and fix it |
@alamb resolved the merge conflict with the new |
I am looking at the WASM issue |
I think we are ready , let's merge this in! |
Thanks again @ion-elgreco for helping push this over the line |
Which issue does this PR close?
Adds support for spawning reqwuests tasks to another Runtime. Credits to @tustvold, I simply added an additional connector in there to make it easier for others to integrate this in their code base.
Handle
arrow-rs#7253Example:
Rationale for this change
Allows a separation of cpu bound tasks and io bound tasks
What changes are included in this PR?
Are there any user-facing changes?
Only an additional http_connector.
cc @alamb 😃