Skip to content

Conversation

bartekpacia
Copy link
Contributor

@bartekpacia bartekpacia commented Nov 5, 2022

I've lost some time when trying to build a very simple pub-sub (without looking at the examples).

I called Socket.Listen() in my sub, and Socket.Dial() on my pub. It had to be reversed to work. I thought docs could clarify this.

Also, I think it a bit confusing that my publisher calls Listen(), as if it was listening for messages. Why was this named like this?

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.

LGTM.

thanks for your interest in go/zmq4.
could you send another PR against go-zeromq/license adding yourself to the list of CONTRIBUTORS and/or AUTHORS ?

thanks again.

@codecov
Copy link

codecov bot commented Nov 5, 2022

Codecov Report

Base: 67.71% // Head: 67.54% // Decreases project coverage by -0.16% ⚠️

Coverage data is based on head (63f5ffd) compared to base (217f26c).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #135      +/-   ##
==========================================
- Coverage   67.71%   67.54%   -0.17%     
==========================================
  Files          29       29              
  Lines        1821     1821              
==========================================
- Hits         1233     1230       -3     
- Misses        487      489       +2     
- Partials      101      102       +1     
Impacted Files Coverage Δ
rep.go 69.17% <0.00%> (-1.51%) ⬇️
internal/inproc/inproc.go 70.88% <0.00%> (-1.27%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bartekpacia
Copy link
Contributor Author

@sbinet Sure, will do.

Also could you answer my question?

I called Socket.Listen() in my sub, and Socket.Dial() on my pub. It had to be reversed to work. I thought docs could clarify this.
Also, I think it a bit confusing that my publisher calls Listen(), as if it was listening for messages. Why was this named like this?

@sbinet
Copy link
Contributor

sbinet commented Nov 6, 2022

needs go-zeromq/license#14

@sbinet
Copy link
Contributor

sbinet commented Nov 6, 2022

I called Socket.Listen() in my sub, and Socket.Dial() on my pub. It had to be reversed to work. I thought docs could clarify this.
Also, I think it a bit confusing that my publisher calls Listen(), as if it was listening for messages. Why was this named like this?

the Dial/Listen pair is the usual Go vocabulary.
I felt compelled to follow this naming convention for a pure-Go package.

another way of describing the pub/sub network, if you will, could be:

  • a publisher listens/waits for new subscribers to subscribe to its feed(s)/topic(s)
  • a subscriber dials/connects to a publisher and subscribes to topics.

@sbinet
Copy link
Contributor

sbinet commented Nov 6, 2022

thanks for the PR :)

@sbinet sbinet merged commit 7197359 into go-zeromq:main Nov 6, 2022
@bartekpacia
Copy link
Contributor Author

another way of describing the pub/sub network, if you will, could be:

  • a publisher listens/waits for new subscribers to subscribe to its feed(s)/topic(s)
  • a subscriber dials/connects to a publisher and subscribes to topics.

I didn't think about it this way. It makes sense now!

the Dial/Listen pair is the usual Go vocabulary. I felt compelled to follow this naming convention for a pure-Go package.

I agree with this choice, thanks for following Go idioms in this awesome module :)

@bartekpacia bartekpacia deleted the docs/improve branch November 6, 2022 11:29
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