I am trying to figure out if i have two routines calling the same zeromq socket if when the return from socket.recv() on routine1 returns.. the socket will know to return to routine1 (ditto for routine2, ... routinen).
Hence... using a messaging bus with request/response semantics, what is the best pattern to approach this in go?
If it helps.. think about the simple pirate pattern and implementing an RPC style call set in that pattern with zeromq.
Socket; //zeromq socket
//routine 1
socket.send(data) // do i need some identifier here for this routine?
socket.recv() // wait until i get a response from that send
//routine 2
socket.send(data)
socket.recv()
so in this case i have no idea if the response from routine1 or routine2 will come back first. How can i make sure that when i get a response to socket... i can notify the correct routines' recv() function.
Thanks!