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

The option to send to a ZMQ socket in the hive-watcher needs to check if a socket is there! #47

Open
brianoflondon opened this issue Jun 3, 2021 · 6 comments

Comments

@brianoflondon
Copy link
Contributor

@agates hoping Alecks can get to this one, there really needs to be some kind of error trapping and so on so that if you try to start the watcher with output to a socket and no socket is available, it just stops trying.

I'm really not sure the correct way to do this? Should there be some kind of opening handshake or so on?

I took a look but I think this is beyond anything I can learn quickly so I'm backing off. The code works but if you run with a socket and there isn't a socket to send to it isn't pretty.

@brianoflondon
Copy link
Contributor Author

I should mention I'm using this to test the docker version.

I have a hive-watcher running and sending to a ZMQ socket every new ping on the main Hive chain.

Then I'm running the hive-writer on the --test chain and receiving pings on the zmq socket and it works brilliantly for testing.

But it all collapses in a heap if you start or stop one side or the other.

@daveajones
Copy link
Contributor

That’s odd. I thought one of the main functions of ZMQ was graceful handling/recovery of socket failure on the other side.

@brianoflondon
Copy link
Contributor Author

I have a feeling there's voodoo in how to open particular sockets so as not to care what comes back. My eyes glazed over looking at the docs so I'm hoping @agates will fix something very obvious.

@agates
Copy link
Collaborator

agates commented Jun 3, 2021

Brian,

hive-watcher isn't using ZMQ. I would recommend switching it to ZMQ and having hive-watcher bind as a publisher socket. Then whatever client can connect to hive-water as a subscriber.

@brianoflondon
Copy link
Contributor Author

Brian,

hive-watcher isn't using ZMQ. I would recommend switching it to ZMQ and having hive-watcher bind as a publisher socket. Then whatever client can connect to hive-water as a subscriber.

Actually I did add ZMQ today but I need to pull that to Dave's Repo.

But it was the clue that I should be using publisher that I think was the problem with what I was doing.

@brianoflondon
Copy link
Contributor Author

I've just put in a pull request. I think I know the problem which is that I'm waiting for a message response but I should just be acting as a publisher and spitting stuff out no matter who's listening.

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

No branches or pull requests

3 participants