117 bool stop(
bool block =
false);
An actor is a thread with a pair socket connected to its parent.
Definition: actor.hpp:53
socket * pipe()
Definition: actor.cpp:138
bool retval_
Definition: actor.hpp:167
bool stopped_
Keeps track of the status of the actor thread.
Definition: actor.hpp:165
std::exception_ptr eptr_
Definition: actor.hpp:160
bool stop(bool block=false)
Sends signal::stop to the actor thread.
Definition: actor.cpp:94
std::string bind_parent()
Bind the parent socket and return the endpoint used.
Definition: actor.cpp:148
socket * child_pipe_
The child end of the pipe.
Definition: actor.hpp:150
socket * parent_pipe_
The parent thread socket.
Definition: actor.hpp:144
actor(ActorStartRoutine routine)
Create a new actor.
Definition: actor.cpp:32
actor & operator=(actor &&o)
Move-assignment operator.
Definition: actor.cpp:78
virtual ~actor()
Definition: actor.cpp:88
std::mutex mutex_
Definition: actor.hpp:158
actor(const actor &)=delete
void start_routine(socket *child, ActorStartRoutine routine)
Call a user defined function and performs cleanup once it returns.
Definition: actor.cpp:118
std::function< bool(socket *pipe)> ActorStartRoutine
The user defined function type.
Definition: actor.hpp:58
static context actor_pipe_ctx_
This static, per process zmqpp::context, is used to connect PAIR socket between Actor and their paren...
Definition: actor.hpp:156
The context class represents internal zmq context and io threads.
Definition: context.hpp:47
The socket class represents the zmq sockets.
Definition: socket.hpp:76
C++ wrapper around zmq.
Definition: actor.cpp:30