ZIO
Python and C++ interface to ZeroMQ and Zyre
|
implementation of ZIO data flow protocol endpoints More...
Namespaces | |
__main__ | |
domo | |
flow | |
ZIO data flow. | |
jsonnet | |
level | |
lispish | |
mains | |
node | |
peer | |
port | |
rules | |
tens | |
util | |
Classes | |
struct | CoordHeader |
class | exception |
general exception class for zio More... | |
struct | Header |
class | Message |
a ZIO message More... | |
class | message_error |
exception indicating message error More... | |
class | Node |
An identified vertex in a ported, directed graph. More... | |
class | Outbox |
output objects of a fixed native type with levels expressed as methods. More... | |
class | Peer |
Peer at the network to discover peers and advertise self. More... | |
struct | peer_info_t |
class | Port |
A port holds a socket in the context of a node. More... | |
struct | PrefixHeader |
class | socket_error |
exception indicating a socket error More... | |
class | zactor_t |
Typedefs | |
using | json = nlohmann::json |
typedef uint64_t | origin_t |
typedef uint64_t | granule_t |
typedef uint64_t | seqno_t |
typedef Outbox< std::string > | Logger |
two special types of outboxes. More... | |
typedef Outbox< zio::json > | Metric |
Emit structured data. More... | |
typedef std::string | nickname_t |
A peer asserts a nickname. More... | |
typedef std::string | uuid_t |
Uniquely identify a peer. More... | |
typedef std::string | header_key_t |
A "header" is on in a set of key/value pairs asserted by a peer. More... | |
typedef std::string | header_value_t |
typedef std::pair< header_key_t, header_value_t > | header_t |
typedef std::map< header_key_t, header_value_t > | headerset_t |
typedef std::map< uuid_t, peer_info_t > | peerset_t |
typedef std::shared_ptr< Port > | portptr_t |
The context can't be copied and ports like to be shared. More... | |
typedef std::chrono::milliseconds | time_unit_t |
typedef std::string | remote_identity_t |
Functions | |
std::pair< socket_t, socket_t > | create_linked_pairs (context_t &ctx) |
int | sock_type (const socket_t &sock) |
Return the ZeroMQ socket type number for the socket. More... | |
std::string | sock_type_name (int stype) |
void | init_signals () |
void | init_logging () |
void | init_all () |
remote_identity_t | recv_serverish (socket_t &socket, multipart_t &mmsg) |
remote_identity_t | recv_server (socket_t &server_socket, multipart_t &mmsg) |
remote_identity_t | recv_router (socket_t &router_socket, multipart_t &mmsg) |
void | send_serverish (socket_t &socket, multipart_t &mmsg, remote_identity_t rid) |
void | send_server (socket_t &server_socket, multipart_t &mmsg, remote_identity_t rid) |
void | send_router (socket_t &router_socket, multipart_t &mmsg, remote_identity_t rid) |
void | recv_clientish (socket_t &socket, multipart_t &mmsg) |
void | recv_client (socket_t &client_socket, multipart_t &mmsg) |
void | recv_dealer (socket_t &dealer_socket, multipart_t &mmsg) |
void | send_clientish (socket_t &socket, multipart_t &mmsg) |
void | send_client (socket_t &client_socket, multipart_t &mmsg) |
void | send_dealer (socket_t &dealer_socket, multipart_t &mmsg) |
std::chrono::milliseconds | now_ms () |
std::chrono::microseconds | now_us () |
void | sleep_ms (std::chrono::milliseconds zzz) |
bool | interrupted () |
void | catch_signals () |
Variables | |
const int | HEARTBEAT_LIVENESS = 3 |
const time_unit_t | HEARTBEAT_INTERVAL {2500} |
const time_unit_t | HEARTBEAT_EXPIRY {HEARTBEAT_INTERVAL * HEARTBEAT_LIVENESS} |
implementation of ZIO data flow protocol endpoints
An actor is a function running in a thread with a control link to the parent thread.
This actor implements the "mini protocol" for startup/shutdown used by CZMQ
ZIO domo protocol constants
This header holds 7/MDP constants.
Functions to manage message data including send and receiving with a socket.
Handle TENS message form.
The zio module provides Python functionality similar to C++ libzio. This module does not bepend on libzio and instead uses PyZMQ and Pyre. The Python classes are similar if not exactly the same as those found in the zio:: C++ namespace. >>> import zio >>> n = zio.Node(...) >>> p = n.port("portname", zmq.CLIENT) >>> p.bind(...) >>> p.connect(...) >>> f = zio.Flow(p) >>> bot = f.bot() >>> dat = ... >>> ok = f.dat(dat)
typedef uint64_t zio::granule_t |
Definition at line 37 of file message.hpp.
typedef std::string zio::header_key_t |
typedef std::pair<header_key_t, header_value_t> zio::header_t |
typedef std::string zio::header_value_t |
typedef std::map<header_key_t, header_value_t> zio::headerset_t |
using zio::json = typedef nlohmann::json |
Definition at line 9 of file interned.hpp.
typedef Outbox<std::string> zio::Logger |
two special types of outboxes.
A text based logger to use like print().
Definition at line 65 of file outbox.hpp.
typedef Outbox<zio::json> zio::Metric |
Emit structured data.
Definition at line 68 of file outbox.hpp.
typedef std::string zio::nickname_t |
typedef uint64_t zio::origin_t |
Definition at line 36 of file message.hpp.
typedef std::map<uuid_t, peer_info_t> zio::peerset_t |
typedef std::shared_ptr<Port> zio::portptr_t |
typedef std::string zio::remote_identity_t |
typedef uint64_t zio::seqno_t |
Definition at line 38 of file message.hpp.
typedef std::chrono::milliseconds zio::time_unit_t |
typedef std::string zio::uuid_t |
void zio::catch_signals | ( | ) |
Catch signals and set interrupted to true.
This should be called from main(). For higher level interface, see zio::init_signals() or zio::init_all() from zio/main.hpp.
bool zio::interrupted | ( | ) |
Return true when a signal has been sent to the application.
Exit main loop if ever true.
The catch_signals() function must be called in main() for this to ever return true.
std::chrono::milliseconds zio::now_ms | ( | ) |
std::chrono::microseconds zio::now_us | ( | ) |
void zio::recv_client | ( | socket_t & | client_socket, |
multipart_t & | mmsg | ||
) |
void zio::recv_clientish | ( | socket_t & | socket, |
multipart_t & | mmsg | ||
) |
void zio::recv_dealer | ( | socket_t & | dealer_socket, |
multipart_t & | mmsg | ||
) |
remote_identity_t zio::recv_router | ( | socket_t & | router_socket, |
multipart_t & | mmsg | ||
) |
remote_identity_t zio::recv_server | ( | socket_t & | server_socket, |
multipart_t & | mmsg | ||
) |
remote_identity_t zio::recv_serverish | ( | socket_t & | socket, |
multipart_t & | mmsg | ||
) |
void zio::send_client | ( | socket_t & | client_socket, |
multipart_t & | mmsg | ||
) |
void zio::send_clientish | ( | socket_t & | socket, |
multipart_t & | mmsg | ||
) |
void zio::send_dealer | ( | socket_t & | dealer_socket, |
multipart_t & | mmsg | ||
) |
void zio::send_router | ( | socket_t & | router_socket, |
multipart_t & | mmsg, | ||
remote_identity_t | rid | ||
) |
void zio::send_server | ( | socket_t & | server_socket, |
multipart_t & | mmsg, | ||
remote_identity_t | rid | ||
) |
void zio::send_serverish | ( | socket_t & | socket, |
multipart_t & | mmsg, | ||
remote_identity_t | rid | ||
) |
void zio::sleep_ms | ( | std::chrono::milliseconds | zzz | ) |
int zio::sock_type | ( | const socket_t & | sock | ) |
Return the ZeroMQ socket type number for the socket.
Definition at line 6 of file interned.cpp.
std::string zio::sock_type_name | ( | int | stype | ) |
Definition at line 11 of file interned.cpp.
const time_unit_t zio::HEARTBEAT_EXPIRY {HEARTBEAT_INTERVAL * HEARTBEAT_LIVENESS} |
const time_unit_t zio::HEARTBEAT_INTERVAL {2500} |