summaryrefslogtreecommitdiff
path: root/src/pipe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pipe.cpp')
-rw-r--r--src/pipe.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pipe.cpp b/src/pipe.cpp
index a8e7bb9..e738128 100644
--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -146,6 +146,19 @@ bool zmq::writer_t::write (zmq_msg_t *msg_)
// TODO: Adjust size of the pipe.
}
+void zmq::writer_t::rollback ()
+{
+ while (true) {
+ zmq_msg_t msg;
+ if (!pipe->unwrite (&msg))
+ break;
+ zmq_msg_close (&msg);
+ }
+
+ // TODO: We don't have to inform the reader side of the pipe about
+ // the event. We'll simply adjust the pipe size and keep calm.
+}
+
void zmq::writer_t::flush ()
{
if (!pipe->flush ())