feat: Add SpawnService and SpawnedReqwestConnector for running requests on a different runtime#332
Conversation
5e37401 to
0b2ff8c
Compare
0b2ff8c to
92ce4c3
Compare
alamb
left a comment
There was a problem hiding this comment.
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
alamb
left a comment
There was a problem hiding this comment.
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.
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.
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 |
…quests on a different runtime (apache#332) * feat: spawn service * feat: add SpawnedReqwestConnector * chore: add zed settings to .gitignore * chore: add docs * Tweak main page documentation * Update documentation and fix example * Fix ci * Add end to end integration test * cleanup test * use separate bucket for test * try and fix wasm build --------- Co-authored-by: Raphael Taylor-Davies <[email protected]> Co-authored-by: Andrew Lamb <[email protected]>
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.
Handlearrow-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 😃