Skip to content
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

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

Alexei-Kornienko
Copy link
Collaborator

This enables us to connect socket to server that doesn't exist yet.

@Alexei-Kornienko
Copy link
Collaborator Author

@TheButlah pls review when you have time. This MR partially fixes #73.

Copy link
Contributor

@TheButlah TheButlah left a 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

@@ -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)> {
Copy link
Contributor

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

Copy link
Collaborator Author

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Alexei-Kornienko
Copy link
Collaborator Author

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.
@Alexei-Kornienko Alexei-Kornienko merged commit 636eb05 into master Jan 8, 2021
@Alexei-Kornienko Alexei-Kornienko deleted the alex/connect_forever branch January 8, 2021 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants