[zeromq-dev] design communication protocols

Michel Pelletier pelletier.michel at gmail.com
Fri Aug 17 16:49:24 CEST 2012


On Fri, Aug 17, 2012 at 3:41 AM, andrea crotti
<andrea.crotti.0 at gmail.com> wrote:

>     @classmethod
>     def unserialise(self, st):
>         act, msg = st.split(DELIMITER)
>         return WorkerSinkProtocol(act, msg)

Minor nit here, you probably want:

     @classmethod
     def unserialise(cls, st):
         act, msg = st.split(DELIMITER)
         return cls(act, msg)

This will allow you to unserialize WorkerSinkProtocol subclasses correctly.

-Michel



More information about the zeromq-dev mailing list