salsa 0.7.1
|
ZeroMQ implementation of salsa actor class. More...
#include <ActorZmq.hh>
Public Member Functions | |
ActorZmq () | |
virtual | ~ActorZmq () |
virtual void | pipe (void *pipe) |
Setter for pipe. | |
virtual int | init () |
First function. | |
virtual int | exec () |
Main function. | |
virtual int | finish () |
Last function. | |
void | timeout (int t) |
Sets timeout. | |
int | timeout () const |
Returns timeout. | |
virtual void * | wait () |
zpoller_t * | poller () const |
PollerZmq * | pollerZmq () const |
bool | terminated () const |
Flag if actor should be terminated. | |
Static Public Member Functions | |
static void | SalsaActorFn (zsock_t *pPipe, void *pArgv) |
static void | SalsaActorForkFn (zsock_t *pPipe, void *pArgv) |
Actor function with fork capability. | |
static std::sig_atomic_t | interrupted () |
Returns if salsa is interrupted. | |
static void | interrupted (std::sig_atomic_t sig) |
Setter salsa interruption. | |
static void | signalHandler (int signalNumber) |
Setter salsa interruption. | |
static std::shared_ptr< spdlog::logger > | getConsoleOutput () |
Get console output. | |
static void | setConsoleLevel (spdlog::level::level_enum level) |
Sets console log level. | |
Protected Attributes | |
zsock_t * | mpPipe = nullptr |
Zmq pipe socket. | |
PollerZmq * | mpPoller = nullptr |
Internal poller. | |
bool | mTerminated = false |
Flag if actor should be terminated. | |
int | mTimeout = -1 |
Poller timeout. | |
Static Private Member Functions | |
static void | actorProcwaitSupport_ (zsock_t *pipe, void *argv) |
Support actor method (used for PID waiting) | |
Static Private Attributes | |
static std::sig_atomic_t | msInterrupted = 0 |
flag if salsa is interrupted | |
static std::shared_ptr< spdlog::logger > | mspConsoleLogger = spdlog::stdout_color_mt("salsa") |
Pointer to spd logger. | |
ZeroMQ implementation of salsa actor class.
Definition at line 19 of file ActorZmq.hh.
Salsa::ActorZmq::ActorZmq | ( | ) |
Constructor
Definition at line 4 of file ActorZmq.cc.
References Salsa::Actor::Actor(), and mpPoller.
Referenced by Salsa::NodeZyre::NodeZyre(), and SalsaActorFn().
|
virtual |
|
staticprivate |
Support actor method (used for PID waiting)
Definition at line 311 of file ActorZmq.cc.
References Salsa::Log::fd(), and Salsa::Log::write().
Referenced by SalsaActorForkFn().
|
virtual |
Main function.
Exec
Implements Salsa::Actor.
Reimplemented in Salsa::NodeZyre.
Definition at line 393 of file ActorZmq.cc.
References Salsa::Actor::interrupted(), mTerminated, and wait().
Referenced by SalsaActorFn().
|
virtual |
Last function.
Finish
Implements Salsa::Actor.
Reimplemented in Salsa::NodeZyre.
Definition at line 415 of file ActorZmq.cc.
Referenced by SalsaActorFn().
|
inlinestaticinherited |
Get console output.
Definition at line 21 of file Object.hh.
References mspConsoleLogger.
Referenced by Salsa::ConfigZyre::apply().
|
virtual |
First function.
Init
Implements Salsa::Actor.
Reimplemented in Salsa::NodeZyre.
Definition at line 378 of file ActorZmq.cc.
References Salsa::Actor::signalHandler().
Referenced by Salsa::NodeZyre::init(), and SalsaActorFn().
|
inlinestaticinherited |
Returns if salsa is interrupted.
Definition at line 35 of file Actor.hh.
References msInterrupted.
Referenced by Salsa::ActorZmq::exec(), Salsa::NodeZyre::exec(), Salsa::ActorZmq::SalsaActorFn(), and signalHandler().
|
inlinestaticinherited |
|
virtual |
Setter for pipe.
Setting pipe socket
Implements Salsa::Actor.
Definition at line 359 of file ActorZmq.cc.
References mpPipe, and mpPoller.
Referenced by SalsaActorFn().
zpoller_t * Salsa::ActorZmq::poller | ( | ) | const |
PollerZmq * Salsa::ActorZmq::pollerZmq | ( | ) | const |
|
static |
Actor function engine
Definition at line 22 of file ActorZmq.cc.
References ActorZmq(), exec(), finish(), init(), Salsa::Actor::interrupted(), pipe(), and terminated().
|
static |
Actor function with fork capability.
Definition at line 57 of file ActorZmq.cc.
References actorProcwaitSupport_(), Salsa::Log::add(), Salsa::Log::create(), Salsa::Log::fd(), and Salsa::Log::spd().
Referenced by Salsa::NodeManagerZyre::addTaskSlot().
|
inlinestaticinherited |
|
staticinherited |
Setter salsa interruption.
Function for handling signals
Definition at line 19 of file Actor.cc.
References interrupted(), and msInterrupted.
Referenced by Salsa::ActorZmq::init().
|
inline |
Flag if actor should be terminated.
Definition at line 40 of file ActorZmq.hh.
References mTerminated.
Referenced by SalsaActorFn().
|
inline |
|
inline |
|
virtual |
Waiting for event
Definition at line 426 of file ActorZmq.cc.
References mpPipe, mpPoller, mTerminated, and mTimeout.
Referenced by exec(), and Salsa::NodeZyre::exec().
|
protected |
Zmq pipe socket.
Definition at line 48 of file ActorZmq.hh.
Referenced by Salsa::NodeZyre::exec(), pipe(), and wait().
|
protected |
Internal poller.
Definition at line 49 of file ActorZmq.hh.
Referenced by ActorZmq(), Salsa::NodeZyre::init(), pipe(), poller(), pollerZmq(), wait(), and ~ActorZmq().
|
staticprivateinherited |
flag if salsa is interrupted
Definition at line 44 of file Actor.hh.
Referenced by interrupted(), interrupted(), and signalHandler().
|
staticprivateinherited |
Pointer to spd logger.
Definition at line 32 of file Object.hh.
Referenced by getConsoleOutput(), and setConsoleLevel().
|
protected |
Flag if actor should be terminated.
Definition at line 50 of file ActorZmq.hh.
Referenced by exec(), Salsa::NodeZyre::exec(), terminated(), and wait().
|
protected |