[zeromq-dev] Proposal: Add sequence number to XRAP requests
Tom Quarendon
tom.quarendon at teamwpc.co.uk
Thu Feb 4 12:21:11 CET 2016
I have made a pull request to the 40/XRAP protocol to add a sequence number to the requests.
Note that I have made this an incompatible change. Open to suggestions on whether it should attempt to maintain compatibility by, for example, changing the signature of the messages.
I also propose removing the restriction that response messages to pipelined requests should be returned in order, or rather added a clarification that they CAN be returned out of order. For a multithreaded server it is unnecessarily complicated to make the server preserve the order.
Thanks.
>From the commit message:
Consider the following scenario.
You have an interactive client that is using XRAP to communicate with a server. Say an interactive music streamer, using the resource schema defined in the XRAP RFC.
Client is using a DEALER socket, server a ROUTER.
Server is NOT running.
Client makes a GET request for a resource.
Request times out, friendly message given to user.
Request message is in clients output queues.
Server starts up.
Request is then delivered to server, server responds.
Client then makes a GET request for a DIFFERENT resource.
Client receives response from the FIRST request. Wrong music plays. User unhappy.
I've tried this, and it works (does what I thought it would, i.e fail).
Consider also writing a multithreaded server. If clients are allowed to pipeline, then there's no practical way of maintaining the order of replies, without there being a client generated sequence number in the request. Again, this is information borne of experience.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160204/54b92a3d/attachment.htm>
More information about the zeromq-dev
mailing list