zeromq / zmqpp

0mq 'highlevel' C++ bindings
http://zeromq.github.io/zmqpp
Mozilla Public License 2.0
438 stars 197 forks source link

zmqpp::actor #51

Closed xaqq closed 10 years ago

xaqq commented 10 years ago

This is a PR following up the discussion in #50 about zthread/zactor.

This PR adds the following:

  1. A zmqpp::actor class, that aims to be similar to CZMQ zactor.
  2. A zmqpp::signal enumeration that regroup different signal code.
  3. zmqpp::socket and zmqpp::message have new methods to deal with zmqpp::signal.

There is however a few differences between zmqpp::actor and zactor:

  1. The user-defined routine that runs in actor thread can notify its parent it failed to initialize, thus causing the actor constructor to throw.
  2. The actor is allowed to fail its shutdown process. There is no difference between a failed shutdown (ie the thread must stop anyway), but the state of the shutdown can be retrieved by the parent (using a blocking call to stop().