[zeromq-dev] Minor update to zmq_reactor
Matt Weinstein
matt_weinstein at yahoo.com
Wed Aug 25 16:44:19 CEST 2010
I believed that it was ripped out of the public zmq_ library a while
back, I had to duplicate it. If it is coming back as a utility
library, I'll dump my version.
Also I'm probably going to shift from returning a string to a
zmq_uuid_t of some sort, probably:
typedef std::vector<unsigned char> uuid_t;
since a uuid can end up with nulls, and c_str() doesn't behave very
well in that case :-)
On Aug 25, 2010, at 9:29 AM, gonzalo diethelm wrote:
> Matt, I have not seen your code, so my comments may not apply. I
> understand there already is code in 0MQ to generate UUIDs; if you
> are reusing / improving this code, I think it would be a good idea
> to encapsulate it in a single place.
>
> In addition, I have always thought UUID generation should be one of
> the utility functions from 0MQ (same as zmq_stopwatch_start,
> zmq_stopwatch_stop and zmq_sleep). UUIDs are really important for
> almost any non-trivial use of 0MQ, and having one single
> implementation (that could be exported to all bindings) makes sense
> IMHO.
>
> Best regards.
>
> Gonzalo Diethelm
>
> From: zeromq-dev-bounces at lists.zeromq.org [mailto:zeromq-dev-bounces at lists.zeromq.org
> ] On Behalf Of Matt Weinstein
> Sent: Wednesday, 25 August, 2010 09:00
> To: zeromq-dev at lists.zeromq.org
> Subject: [zeromq-dev] Minor update to zmq_reactor
>
> Folks,
>
> On branch poll_items:
>
> - Updated zmq_reactor_uuid to use a more standard uuid generator.
> - Fixed missing endlines, #endifs etc.
>
> No new functionality.
>
> zmq_reactor is being staged into production for a client, it's very
> useful. The nice part is you can write a class that looks like this:
>
>
> class reactor_io {
>
> shared state;
>
> int reactor_inbound( ... ) {
> do something
> has access to shared state;
> }
>
> int reactor_outbound( ... ) {
> do something
> has access to shared state;
> }
>
> ...
>
>
> int poll()
> {
> setup the reactors[]
> do the zmq_reactor_poll() here
> return poll result
> }
> };
>
> Essentially, you wrap the whole reactor framework (=device) in a
> single class.
>
> I used a template<> static binding function to remove the muss and
> fuss there.
>
> Best,
> Matt
>
>
> Declaración de confidencialidad: Este Mensaje esta destinado para el
> uso de la o las personas o entidades a quien ha sido dirigido y
> puede contener información reservada y confidencial que no puede ser
> divulgada, difundida, ni aprovechada en forma alguna. El uso no
> autorizado de la información contenida en este correo podrá ser
> sancionado de conformidad con la ley chilena. Si usted ha recibido
> este correo electrónico por error, le pedimos eliminarlo junto con
> los archivos adjuntos y avisar inmediatamente al remitente,
> respondiendo este mensaje.
>
> Disclosure: This Message is to be used by the individual,
> individuals or entities that it is addressed to and may include
> private and confidential information that may not be disclosed, made
> public nor used in any way at all. Unauthorized use of the
> information in this electronic mail message may be subject to the
> penalties set forth by Chilean law. If you have received this
> electronic mail message in error, we ask you to destroy the message
> and its attached file(s) and to immediately notify the sender by
> answering this message._______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100825/1be5aa19/attachment.htm>
More information about the zeromq-dev
mailing list