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

ZeroMQ without cgo? #218

Open
kmpm opened this issue Jan 18, 2025 · 5 comments · May be fixed by #219
Open

ZeroMQ without cgo? #218

kmpm opened this issue Jan 18, 2025 · 5 comments · May be fixed by #219
Assignees

Comments

@kmpm
Copy link
Contributor

kmpm commented Jan 18, 2025

I would like to use zeromq from time to time, but I don't like having to use CGO.

Would there be any interest if I made a new set of components zmq4n (instead of zmq4) using native go and the library https://github.com/go-zeromq/zmq4 ?

@gregfurman
Copy link
Collaborator

Hey! This is a great suggestion and sounds like a clear value add 🙂 Couple of questions:

  • Do you know if the native Go library a drop-in replacement for the current "github.com/pebbe/zmq4" dependency?
  • Unsure the state of the https://github.com/go-zeromq/zmq4 project (not much ZeroMQ knowledge). Is it still being actively maintained?

@kmpm
Copy link
Contributor Author

kmpm commented Jan 19, 2025

To answer your questions.

  • No, github.com/go-zeromq/zmq4 is not a drop in replacement but it's a small enough code change that it took me less than an hour to do it and I do already have a branch with it, almost ready to possibly create a PR.
  • There is more to wish for when it comes to the maintenance of go-zeromq project but it's not completely unmaintained. And it's much easier for one, like me, that needs to build with zmq and as a windows or arm64 binary. Cross OS or Arch with CGO is no fun.

@gregfurman
Copy link
Collaborator

OK awesome. Feel free to re-use or take liberties from the already existing test suite.

Also I'll assign this issue to you. Let me know if you need any assistance and thanks for the initiative here 😃

@kmpm
Copy link
Contributor Author

kmpm commented Jan 19, 2025

I have one question at the moment that you could answer before I create the PR.

Would you like to have this new component included in the default all build or not. Since they are named differently they can coexist but I could use build tags and for example // +build !x_bento_extra build when NOT x_bento_extra is set but that seems more complicated.

@gregfurman
Copy link
Collaborator

Don't worry about both components co-existing. So long as the components are named differently, I think include it in the all package.

At a later stage, and if we have evidence that both components (zmq4 and zmq4n) are functionally identical, maybe we can look into the latter component as a drop-in replacement for the former when not compiling in CGO.

Open the PR whenever you're ready 👍

@kmpm kmpm linked a pull request Jan 19, 2025 that will close this issue
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 a pull request may close this issue.

2 participants