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

zmq4: implement proper REQ and REP socket #76

Merged
merged 3 commits into from
Feb 24, 2020
Merged

Conversation

Inphi
Copy link
Contributor

@Inphi Inphi commented Feb 21, 2020

This fixes problems with REP sending messages to all connected peers
rather than to the originating peer.

The REQ/REP semantics now matches the recommended implementation behavior as specified in the ZMQ RFC.
In particular:

  • REQ shall route outgoing messages to connected peers using a
    round-robin strategy
  • REQ shall block on sending, or return a suitable error, when it has no
    connected peers.
  • REP shall not block on sending

Thus, this changes the behavior a bit as REP no longer blocks on Send.

resolves #70

@Inphi Inphi requested a review from sbinet February 21, 2020 07:02
This fixes problems with REP sending messages to all connected peers
rather than to the originating peer.

The REQ/REP semantics now matches the recommended implementation behavior as specified in the ZMQ RFC.
In particular:
* REQ shall route outgoing messages to connected peers using a
round-robin strategy
* REQ shall block on sending, or return a suitable error, when it has no
connected peers.
* REP shall not block on sending

Thus, this changes the behavior a bit as REP no longer blocks on Send.

resolves go-zeromq#70
@codecov-io
Copy link

codecov-io commented Feb 21, 2020

Codecov Report

Merging #76 into master will decrease coverage by 0.49%.
The diff coverage is 64.55%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #76     +/-   ##
=========================================
- Coverage   68.36%   67.86%   -0.5%     
=========================================
  Files          27       27             
  Lines        2023     2247    +224     
=========================================
+ Hits         1383     1525    +142     
- Misses        546      621     +75     
- Partials       94      101      +7
Impacted Files Coverage Δ
req.go 59.81% <56.32%> (-15.19%) ⬇️
rep.go 69.76% <69.33%> (-5.24%) ⬇️
conn.go 58.94% <0%> (ø) ⬆️
internal/inproc/inproc.go 71.57% <0%> (-1.06%) ⬇️
msgio.go 59.12% <0%> (+0.3%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 88cc4eb...df0a026. Read the comment docs.

Copy link
Contributor

@sbinet sbinet left a comment

Choose a reason for hiding this comment

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

thanks for tackling this issue.

@sbinet sbinet merged commit 7f9b0a0 into go-zeromq:master Feb 24, 2020
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.

zmq4: implement proper REQ/REP semantics
4 participants