There are a few patterns. For simple commands, no handshaking is needed. The default is to handshake (with a signal, which is a special short message) only at actor startup and at destruction.
For more complex protocols, or for cases where you need to wait for command completion, it's a good idea to switch to fully synchronous, with handshaking on every command. This is the zauth case. If you configure security and don't wait for that to end, things get confused. And then for complex protocols + data flow, we open a second socket to the actor on which we send data (in one or both directions), which is async and not handshaked. The mlm_server API falls into the "simple" category. On Mon, Jan 11, 2016 at 10:32 AM, Michal Vyskocil <[email protected]> wrote: > Hi, > > I have been exploring usage of actors in our project, so I started to > model some parts as actors. To setup it, there is a simple protocol > inspired by mlm_server ("VERBOSE", "CONNECT", "CONFIG", ...) > > It seems that there are two approaches > 1.) mlm_server > (https://github.com/zeromq/malamute/blob/master/src/mlm_server_engine.inc#L1395) > 2.) zauth (https://github.com/zeromq/czmq/blob/master/src/zauth.c#L158) > > While zauth signals end of command processing by zsock_signal, > mlm_server don't do that. > > Which approach is recommended? As we have had some timing issues and > using zclock_sleep does not looks good, using zsock_signal seems like > a better way to handle actor's configuration. > > -- > best regards > Michal Vyskocil > _______________________________________________ > zeromq-dev mailing list > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
