-
Notifications
You must be signed in to change notification settings - Fork 18
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
Implement super_stream #232
Conversation
src/superstream_producer.rs
Outdated
} | ||
|
||
let producer = self.1.get(route.as_str()).unwrap(); | ||
let _ = producer.send(message.clone(), cb.clone()).await?; |
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.
@wolf4ood I was wondering if we can limit the usage of clone() here for message and cb. I made some tests but apparently this is not so trivial
688ea68
to
ffa07fb
Compare
9f574f7
to
0a325fe
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #232 +/- ##
==========================================
+ Coverage 88.73% 89.75% +1.02%
==========================================
Files 75 78 +3
Lines 6410 6658 +248
==========================================
+ Hits 5688 5976 +288
+ Misses 722 682 -40 ☔ View full report in Codecov by Sentry. |
Hey @Gsantomaggio @wolf4ood I know this is quite huge, but if you get time to start reviewing it when you have time it would be great. I created examples in the doc folders. There are still a couple of small issues (written above) and probably the filtering part integration needs to be tested more carefully but I think we are in a good way now! |
0a325fe
to
0a3a6ec
Compare
ed241ef
to
153432e
Compare
3325f06
to
19fa5bf
Compare
@DanielePalaia, the super-stream producer and super-stream consumer, seems to work correctly :)! There is some problem with the connections. Changed the examples in this way: let environment = Environment::builder().port(5553).load_balancer_mode(true).build().await?; Then: use std::io::{stdin,stdout,Write};
let mut s=String::new();
print!("Please enter close the super stream consumer");
let _=stdout().flush();
stdin().read_line(&mut s).expect("Did not enter a correct string");
if let Some('\n')=s.chars().next_back() {
s.pop();
}
let _ = super_stream_consumer.handle().close().await;
print!("Please enter close the the example");
let _=stdout().flush();
stdin().read_line(&mut s).expect("Did not enter a correct string");
if let Some('\n')=s.chars().next_back() {
s.pop();
}
println!("Super stream consumer stopped"); Same for the producer: use std::io::{stdin,stdout,Write};
let mut s=String::new();
print!("Please enter close the super stream producer");
let _=stdout().flush();
stdin().read_line(&mut s).expect("Did not enter a correct string");
if let Some('\n')=s.chars().next_back() {
s.pop();
}
let _ = super_stream_producer.close().await;
print!("Please enter close the example");
let _=stdout().flush();
stdin().read_line(&mut s).expect("Did not enter a correct string");
if let Some('\n')=s.chars().next_back() {
s.pop();
}
Ok(()) When the ![]() But all these connections are not linked to any stream. All the connections should be closed. |
ae18182
to
a3aa351
Compare
Signed-off-by: Gabriele Santomaggio <[email protected]>
Signed-off-by: Gabriele Santomaggio <[email protected]>
Signed-off-by: Gabriele Santomaggio <[email protected]>
super_stream_consumer super_stream locator not closed
Ok, with this PR #235, the pending connections problem is solved. There is still some problem with the load-banacer part #236 Great job @DanielePalaia and Thank you @wolf4ood for the review! |
cc4f663
to
924c9eb
Compare
d8dab9d
to
6183315
Compare
6183315
to
2238a20
Compare
This closes #204
This PR implements the superstream functionality both for producer and consumer (For the moment it exclude the single active consumer implementation that will be implemented in a different PR).
It import the murmur3 dependency in order to use the same hashing algorithm also the other clients are using.
Examples are provided in examples folder: send_super_stream.rs and receive_super_stream.rs