// called via work_queue void receive_done() { // Add 1 credit, a receiver has taken a message out of the buffer. receiver_.add_credit(1); }
void on_receiver_open(proton::receiver& r) override { receiver_ = r; std::lock_guard<std::mutex> l(lock_); work_queue_ = &receiver_.work_queue(); receiver_.add_credit(MAX_BUFFER); // Buffer is empty, initial credit is the limit }