-
Notifications
You must be signed in to change notification settings - Fork 105
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 connect_forever in util. Related to #73 #117
Conversation
e42c328
to
1c715b0
Compare
@TheButlah pls review when you have time. This MR partially fixes #73. |
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.
In order to close #73 , we need connect to return immediately, queuing messages until we run out of memory (or hit the currently unimplemented high water mark). Right now the code instead blocks until the connection is successful. This is an improvement, and we can definitely merge it in this state, but let's not close #73 until we implement HWM functionality and make the connect function non-blocking
src/transport/ipc.rs
Outdated
@@ -15,8 +15,8 @@ use crate::ZmqResult; | |||
use futures::{select, FutureExt}; | |||
use std::path::{Path, PathBuf}; | |||
|
|||
pub(crate) async fn connect(path: PathBuf) -> ZmqResult<(FramedIo, Endpoint)> { | |||
let raw_socket = UnixStream::connect(&path).await?; | |||
pub(crate) async fn connect(path: &PathBuf) -> ZmqResult<(FramedIo, Endpoint)> { |
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 we don't need ownership of the PathBuf
, then this should just be an &Path
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.
Thanks for the hint. I'll fix it
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.
Done
I agree. I marked this MR as related cause some additional work is needed to make it fully spec compliant. |
This enables us to connect socket to server that doesn't exist yet.
1c715b0
to
9cb5179
Compare
This enables us to connect socket to server that doesn't exist yet.