ZIO
Python and C++ interface to ZeroMQ and Zyre
|
#include <flow.hpp>
Public Member Functions | |
Flow (portptr_t port) | |
create a flow. More... | |
~Flow () | |
void | send_bot (Message &bot) |
send a BOT More... | |
bool | recv_bot (Message &bot, int timeout=-1) |
receive a BOT More... | |
bool | put (Message &dat) |
put a payload message into the flow More... | |
int | slurp_pay (int timeout) |
recv any waiting PAY messages More... | |
bool | get (Message &dat, int timeout=-1) |
get a payload message from the flow More... | |
int | flush_pay () |
send any accumulated credit as a PAY More... | |
void | send_eot (Message &msg) |
send EOT. More... | |
bool | recv_eot (Message &msg, int timeout=-1) |
Receive an EOT. More... | |
bool | is_sender () const |
int | credit () const |
int | total_credit () const |
zio::flow::Flow::Flow | ( | zio::portptr_t | port | ) |
int zio::flow::Flow::flush_pay | ( | ) |
bool zio::flow::Flow::get | ( | zio::Message & | dat, |
int | timeout = -1 |
||
) |
bool zio::flow::Flow::put | ( | zio::Message & | dat | ) |
bool zio::flow::Flow::recv_bot | ( | zio::Message & | bot, |
int | timeout = -1 |
||
) |
receive a BOT
A timeout, -1 waits forever. Return false if timeout occurs.
Server calls send_bot() first, client calls send_bot() second;
bool zio::flow::Flow::recv_eot | ( | Message & | msg, |
int | timeout = -1 |
||
) |
Receive an EOT.
Return false if no EOT was received, otherwise set msg to that EOT message. Timeout is in milliseconds or less than zero to wait indefinitely.
Note: an app only needs to call recv_eot() if they explicitly initiated with send_eot().
void zio::flow::Flow::send_bot | ( | zio::Message & | bot | ) |
send a BOT
Client calls send_bot() first, server calls send_bot() second;
void zio::flow::Flow::send_eot | ( | Message & | msg | ) |
send EOT.
If a get() or a put() was interupted by an EOT the app should call send_eot() as an acknowledgement and should not call recv_eot(). If app explicitly initates EOT with send_eot() then the app should call recv_eot() to wait for an ack from the other end.
int zio::flow::Flow::slurp_pay | ( | int | timeout | ) |