On Tue, Apr 15, 2014 at 04:36:50PM +0200, Bjorn Reese wrote:
> On 04/15/2014 03:52 PM, Jeff Vienneau wrote:
> 
> > Does it make sense to use C++ 11 futures such that a request could be
> > made that returns a future<zmq_message>? In this way, a number of
> > requests could be issued and then await called on the set of futures?
> >
> > The future would encapsulate the details required to correlate the
> > request with a response.
> >
> > Has anyone mixed these concepts?
> 
> The following answer is of a general nature, and not specific to ZeroMQ.
> 
> Yes, it makes very good sense to use futures. For instance, Boost.Asio
> (which is a socket API, not a messaging API) already supports it:
> 
>    http://www.boost.org/doc/html/boost_asio/reference/use_future_t.html
> 
> For the broader picture you may also be interested in the following
> C++ standards proposal:
> 
>    http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3964.pdf

I do something similar in python. When receiving a request I add a
reply function so I can laster simply do

    req.reply(data)

and the function takes care of picking the right socket and routing info.

MfG
        Goswin
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to