Add onAck and onNack methods
This commit is contained in:
parent
1a955b39af
commit
ddee073278
|
|
@ -42,7 +42,6 @@ private:
|
||||||
*/
|
*/
|
||||||
void process(BasicAckFrame &frame);
|
void process(BasicAckFrame &frame);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process an ACK frame
|
* Process an ACK frame
|
||||||
*
|
*
|
||||||
|
|
@ -85,6 +84,32 @@ public:
|
||||||
// allow chaining
|
// allow chaining
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback that is called when the broker confirmed message publication
|
||||||
|
* @param callback the callback to execute
|
||||||
|
*/
|
||||||
|
DeferredConfirm &onAck(const AckCallback &callback)
|
||||||
|
{
|
||||||
|
// store callback
|
||||||
|
_ackCallback = callback;
|
||||||
|
|
||||||
|
// allow chaining
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback that is called when the broker denied message publication
|
||||||
|
* @param callback the callback to execute
|
||||||
|
*/
|
||||||
|
DeferredConfirm &onNack(const NackCallback &callback)
|
||||||
|
{
|
||||||
|
// store callback
|
||||||
|
_nackCallback = callback;
|
||||||
|
|
||||||
|
// allow chaining
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue