diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-05-30 10:07:34 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-05-30 10:07:34 +0200 |
commit | 0b59866a84f733e5a53b0d2f32570581691747ef (patch) | |
tree | 8861d97915544dc4385177931f299a6f27603c92 /src/pipe.hpp | |
parent | 311fb0d852374e769d8ff791c9df38f0464960c6 (diff) |
Patches from sub-forward branch incorporated
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/pipe.hpp')
-rw-r--r-- | src/pipe.hpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/pipe.hpp b/src/pipe.hpp index 3087ab8..bf34a83 100644 --- a/src/pipe.hpp +++ b/src/pipe.hpp @@ -44,6 +44,7 @@ namespace zmq virtual void read_activated (class pipe_t *pipe_) = 0; virtual void write_activated (class pipe_t *pipe_) = 0; + virtual void hiccuped (class pipe_t *pipe_) = 0; virtual void terminated (class pipe_t *pipe_) = 0; }; @@ -86,6 +87,11 @@ namespace zmq // Flush the messages downsteam. void flush (); + // Temporaraily disconnects the inbound message stream and drops + // all the messages on the fly. Causes 'hiccuped' event to be generated + // in the peer. + void hiccup (); + // Ask pipe to terminate. The termination will happen asynchronously // and user will be notified about actual deallocation by 'terminated' // event. @@ -93,18 +99,19 @@ namespace zmq private: + // Type of the underlying lock-free pipe. + typedef ypipe_t <msg_t, message_pipe_granularity> upipe_t; + // Command handlers. void process_activate_read (); void process_activate_write (uint64_t msgs_read_); + void process_hiccup (void *pipe_); void process_pipe_term (); void process_pipe_term_ack (); // Handler for delimiter read from the pipe. void delimit (); - // Type of the underlying lock-free pipe. - typedef ypipe_t <msg_t, message_pipe_granularity> upipe_t; - // Constructor is private. Pipe can only be created using // pipepair function. pipe_t (object_t *parent_, upipe_t *inpipe_, upipe_t *outpipe_, |