Feat: startAsync and StopAsync callbacks - #1629
Conversation
f951cf4 to
0113c6c
Compare
Cpp-Linter Report
|
450c919 to
fd2f006
Compare
fd2f006 to
c363fe9
Compare
Signed-off-by: dorjesinpo <129227380+dorjesinpo@users.noreply.github.com>
c363fe9 to
43f2917
Compare
Add completion-callback overloads to bmqa async session start/stop
bmqa::Session::startAsync/stopAsyncpreviously reported completion only viasession events, unlike the rest of the async API (
openQueueAsyncet al.) whichtake a completion callback. Add callback-taking overloads that deliver a typed
status to a user callback, mirroring the openQueueAsync pattern.
bmqa::StartStatus/bmqa::StopStatus(result + errordescription), registered in package/bmqa.mem.
AbstractSession; implemented inSessionandMockSession.bmqimp: BrokerSessioncaches the callback on enteringSTARTING(
handleStartRequest) / on accepting a stop (handleStopRequest), and attachesit to the terminal event (
CONNECTED,CONNECTION_TIMEOUT,DISCONNECTED),suppressing that session event and delivering it to the callback instead
(as
openQueueAsyncdoes). Callback runs on the event-delivery thread, neverthe FSM thread. resetState clears any callback that never rode a terminal
event, preventing leaks across start/stop cycles.
Tests: value-semantics tests for
Start/StopStatus;MockSessioncallback case;BrokerSessionreal-FSM case asserting the callback fires and the terminalsession event is suppressed.