ZIO
Python and C++ interface to ZeroMQ and Zyre
Public Member Functions | List of all members
zio::zactor_t Class Reference

#include <actor.hpp>

Public Member Functions

template<typename Func , typename... Args>
 zactor_t (context_t &ctx, Func fn, Args... args)
 
 ~zactor_t ()
 
socket_ref link ()
 

Detailed Description

Spawn a function in a thread and communicate over a link.

The actor function must take a socket and zero or more optional arguments such as:

void func(socket_t& sock, ...);

zio::zactor_t actor(ctx, func, ...);
actor.link().send(...);

The socket passed in to the actor function is one end of a bidirection link shared with the application thread. The application thread may get the other end of that link by calling zio::zactor_t::link().

The actor function is expected to participate in a protocol on the link which is compatible with the requirements of CZMQ zactor_fn actor functions:

Definition at line 75 of file actor.hpp.

Constructor & Destructor Documentation

◆ zactor_t()

template<typename Func , typename... Args>
zio::zactor_t::zactor_t ( context_t ctx,
Func  fn,
Args...  args 
)
inline

Definition at line 80 of file actor.hpp.

◆ ~zactor_t()

zio::zactor_t::~zactor_t ( )
inline

Definition at line 94 of file actor.hpp.

Member Function Documentation

◆ link()

socket_ref zio::zactor_t::link ( )
inline

Definition at line 99 of file actor.hpp.


The documentation for this class was generated from the following file: