-
Notifications
You must be signed in to change notification settings - Fork 704
feat(streaming): use single client for exchange #1051
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
Signed-off-by: Alex Chi <[email protected]>
|
Manually checked the log when running |
Codecov Report
@@ Coverage Diff @@
## main #1051 +/- ##
============================================
- Coverage 71.90% 71.86% -0.05%
Complexity 2766 2766
============================================
Files 994 995 +1
Lines 83486 83549 +63
Branches 1790 1790
============================================
+ Hits 60034 60039 +5
- Misses 22561 22619 +58
Partials 891 891
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
BugenZhao
left a comment
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!
Signed-off-by: Alex Chi <[email protected]>
|
Also I made the |
Signed-off-by: Alex Chi <[email protected]>
| impl ComputeClientPool { | ||
| pub fn new(cache_capacity: u64) -> Self { | ||
| Self { | ||
| cache: Cache::new(cache_capacity), |
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.
We don't have to use Cache actually, we can aggressively store all clients, probably using a hashmap.
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.
This cache provides concurrent waiting on a single creation (get_or_insert_with ensures only one client is created for all in-flight get request), where no HashMap could achieve easily... I think we can disable evict on this cache.
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.
Ok..., sounds like a tokio::Mutex wrapped hashmap.
Signed-off-by: Alex Chi [email protected]
What's changed and what's your intention?
As title
Checklist
Refer to a related PR or issue link (optional)
ref #1023