void pipeline::resume() { if (state != paused) { BOOST_LOG_TRIVIAL(error) << "pipeline(" << this << ") is not paused: " << state; return; } state = running; schedule_read(); }
void abuf_pipe_t::readcb (str s, int err) { _read_outstanding = false; if (!s) { _eof = true; } else { _bufs.push_back (s); } ptr<bool> df = _destroyed; if (_cb) (*_cb) (); if (!*df) schedule_read (); }
void pipeline::schedule_read() { if (state == running && !read_pending) { read_pending = true; in->async_read([this, me = shared_from_this()](const gh::error_code &ec, packet &&p) { read_pending = false; fc.after_read(); if (!ec) { if (!write_pending) { process(std::move(p)); } else { buffer.push(std::move(p)); } } else { BOOST_LOG_TRIVIAL(error) << "pipeline(" << this << ") read error: " << ec.message(); stop(); } schedule_read(); }); } }
void abuf_pipe_t::init (cbv c) { _cb = c; schedule_read (); }