MCPcopy Create free account
hub / github.com/apache/qpid-proton / drain

Method drain

cpp/src/receiver.cpp:69–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void receiver::drain() {
70 link_context &ctx = link_context::get(pn_object());
71 if (ctx.draining)
72 throw proton::error("drain already in progress");
73 else {
74 ctx.draining = true;
75 if (credit() > 0)
76 pn_link_set_drain(pn_object(), true);
77 else {
78 // Drain is already complete. No state to communicate over the wire.
79 // Create dummy flow event where "drain finish" can be detected.
80 pn_connection_t *pnc = pn_session_connection(pn_link_session(pn_object()));
81 pn_collector_put_object(pn_connection_collector(pnc), pn_object(), PN_LINK_FLOW);
82 }
83 }
84}
85
86receiver_iterator receiver_iterator::operator++() {
87 if (!!obj_) {

Callers 3

first_idleMethod · 0.45
fourth_idleMethod · 0.45
run_stageMethod · 0.45

Calls 7

errorClass · 0.85
pn_link_set_drainFunction · 0.85
pn_session_connectionFunction · 0.85
pn_link_sessionFunction · 0.85
pn_collector_put_objectFunction · 0.85
pn_connection_collectorFunction · 0.85
getFunction · 0.70

Tested by 2

first_idleMethod · 0.36
fourth_idleMethod · 0.36