@@ -73,7 +73,10 @@ def subscription_changed(self, event: events.SubscriptionChangedEvent, context:
7373
7474 return PNTransition (
7575 state = HandshakingState ,
76- context = self ._context
76+ context = self ._context ,
77+ invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNSubscriptionChangedCategory ,
78+ operation = PNOperationType .PNSubscribeOperation ,
79+ context = self ._context )
7780 )
7881
7982 def subscription_restored (self , event : events .SubscriptionRestoredEvent , context : PNContext ) -> PNTransition :
@@ -122,7 +125,15 @@ def subscription_changed(self, event: events.SubscriptionChangedEvent, context:
122125
123126 return PNTransition (
124127 state = HandshakingState ,
125- context = self ._context
128+ context = self ._context ,
129+ invocation = [
130+ invocations .EmitStatusInvocation (PNStatusCategory .PNSubscriptionChangedCategory ,
131+ operation = PNOperationType .PNSubscribeOperation ,
132+ context = self ._context ),
133+ invocations .EmitStatusInvocation (PNStatusCategory .PNAcknowledgmentCategory ,
134+ operation = PNOperationType .PNSubscribeOperation ,
135+ context = self ._context ),
136+ ]
126137 )
127138
128139 def subscription_restored (self , event : events .SubscriptionRestoredEvent , context : PNContext ) -> PNTransition :
@@ -148,7 +159,10 @@ def reconnecting(self, event: events.HandshakeFailureEvent, context: PNContext)
148159
149160 return PNTransition (
150161 state = HandshakeReconnectingState ,
151- context = self ._context
162+ context = self ._context ,
163+ invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNConnectionErrorCategory ,
164+ operation = PNOperationType .PNSubscribeOperation ,
165+ context = self ._context )
152166 )
153167
154168 def disconnect (self , event : events .DisconnectEvent , context : PNContext ) -> PNTransition :
@@ -183,8 +197,14 @@ def unsubscribe_all(self, event: events.UnsubscribeAllEvent, context: PNContext)
183197 return PNTransition (
184198 state = UnsubscribedState ,
185199 context = self ._context ,
186- invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNAcknowledgmentCategory ,
187- operation = PNOperationType .PNUnsubscribeOperation )
200+ invocation = [
201+ invocations .EmitStatusInvocation (PNStatusCategory .PNDisconnectedCategory ,
202+ operation = PNOperationType .PNSubscribeOperation ,
203+ context = self ._context ),
204+ invocations .EmitStatusInvocation (PNStatusCategory .PNAcknowledgmentCategory ,
205+ operation = PNOperationType .PNSubscribeOperation ,
206+ context = self ._context ),
207+ ]
188208 )
189209
190210
@@ -218,7 +238,10 @@ def disconnect(self, event: events.DisconnectEvent, context: PNContext) -> PNTra
218238
219239 return PNTransition (
220240 state = HandshakeStoppedState ,
221- context = self ._context
241+ context = self ._context ,
242+ invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNDisconnectedCategory ,
243+ operation = PNOperationType .PNSubscribeOperation ,
244+ context = self ._context )
222245 )
223246
224247 def subscription_changed (self , event : events .SubscriptionChangedEvent , context : PNContext ) -> PNTransition :
@@ -230,7 +253,10 @@ def subscription_changed(self, event: events.SubscriptionChangedEvent, context:
230253
231254 return PNTransition (
232255 state = HandshakeReconnectingState ,
233- context = self ._context
256+ context = self ._context ,
257+ invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNSubscriptionChangedCategory ,
258+ operation = PNOperationType .PNSubscribeOperation ,
259+ context = self ._context )
234260 )
235261
236262 def handshake_reconnect (self , event : events .HandshakeReconnectFailureEvent , context : PNContext ) -> PNTransition :
@@ -240,7 +266,10 @@ def handshake_reconnect(self, event: events.HandshakeReconnectFailureEvent, cont
240266
241267 return PNTransition (
242268 state = HandshakeReconnectingState ,
243- context = self ._context
269+ context = self ._context ,
270+ invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNConnectionErrorCategory ,
271+ operation = PNOperationType .PNSubscribeOperation ,
272+ context = self ._context )
244273 )
245274
246275 def give_up (self , event : events .HandshakeReconnectGiveupEvent , context : PNContext ) -> PNTransition :
@@ -305,7 +334,10 @@ def subscription_changed(self, event: events.SubscriptionChangedEvent, context:
305334
306335 return PNTransition (
307336 state = HandshakingState ,
308- context = self ._context
337+ context = self ._context ,
338+ invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNSubscriptionChangedCategory ,
339+ operation = PNOperationType .PNSubscribeOperation ,
340+ context = self ._context )
309341 )
310342
311343 def reconnect (self , event : events .ReconnectEvent , context : PNContext ) -> PNTransition :
@@ -340,8 +372,14 @@ def unsubscribe_all(self, event: events.UnsubscribeAllEvent, context: PNContext)
340372 return PNTransition (
341373 state = UnsubscribedState ,
342374 context = self ._context ,
343- invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNAcknowledgmentCategory ,
344- operation = PNOperationType .PNUnsubscribeOperation )
375+ invocation = [
376+ invocations .EmitStatusInvocation (PNStatusCategory .PNDisconnectedCategory ,
377+ operation = PNOperationType .PNSubscribeOperation ,
378+ context = self ._context ),
379+ invocations .EmitStatusInvocation (PNStatusCategory .PNAcknowledgmentCategory ,
380+ operation = PNOperationType .PNSubscribeOperation ,
381+ context = self ._context ),
382+ ]
345383 )
346384
347385
@@ -374,8 +412,14 @@ def unsubscribe_all(self, event: events.UnsubscribeAllEvent, context: PNContext)
374412 return PNTransition (
375413 state = UnsubscribedState ,
376414 context = self ._context ,
377- invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNAcknowledgmentCategory ,
378- operation = PNOperationType .PNUnsubscribeOperation )
415+ invocation = [
416+ invocations .EmitStatusInvocation (PNStatusCategory .PNDisconnectedCategory ,
417+ operation = PNOperationType .PNSubscribeOperation ,
418+ context = self ._context ),
419+ invocations .EmitStatusInvocation (PNStatusCategory .PNAcknowledgmentCategory ,
420+ operation = PNOperationType .PNSubscribeOperation ,
421+ context = self ._context ),
422+ ]
379423 )
380424
381425
@@ -412,7 +456,10 @@ def subscription_changed(self, event: events.SubscriptionChangedEvent, context:
412456
413457 return PNTransition (
414458 state = self .__class__ ,
415- context = self ._context
459+ context = self ._context ,
460+ invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNSubscriptionChangedCategory ,
461+ operation = PNOperationType .PNSubscribeOperation ,
462+ context = self ._context )
416463 )
417464
418465 def subscription_restored (self , event : events .SubscriptionRestoredEvent , context : PNContext ) -> PNTransition :
@@ -446,7 +493,10 @@ def receiving_failure(self, event: events.ReceiveFailureEvent, context: PNContex
446493 self ._context .timetoken = event .timetoken
447494 return PNTransition (
448495 state = ReceiveReconnectingState ,
449- context = self ._context
496+ context = self ._context ,
497+ invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNUnexpectedDisconnectCategory ,
498+ operation = PNOperationType .PNSubscribeOperation ,
499+ context = self ._context )
450500 )
451501
452502 def disconnect (self , event : events .DisconnectEvent , context : PNContext ) -> PNTransition :
@@ -477,8 +527,14 @@ def unsubscribe_all(self, event: events.UnsubscribeAllEvent, context: PNContext)
477527 return PNTransition (
478528 state = UnsubscribedState ,
479529 context = self ._context ,
480- invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNAcknowledgmentCategory ,
481- operation = PNOperationType .PNUnsubscribeOperation )
530+ invocation = [
531+ invocations .EmitStatusInvocation (PNStatusCategory .PNDisconnectedCategory ,
532+ operation = PNOperationType .PNSubscribeOperation ,
533+ context = self ._context ),
534+ invocations .EmitStatusInvocation (PNStatusCategory .PNAcknowledgmentCategory ,
535+ operation = PNOperationType .PNSubscribeOperation ,
536+ context = self ._context ),
537+ ]
482538 )
483539
484540
@@ -515,7 +571,10 @@ def reconnect_failure(self, event: events.ReceiveReconnectFailureEvent, context:
515571
516572 return PNTransition (
517573 state = ReceiveReconnectingState ,
518- context = self ._context
574+ context = self ._context ,
575+ invocation = invocations .EmitStatusInvocation (PNStatusCategory .UnexpectedDisconnectCategory ,
576+ operation = PNOperationType .PNSubscribeOperation ,
577+ context = self ._context )
519578 )
520579
521580 def subscription_changed (self , event : events .SubscriptionChangedEvent , context : PNContext ) -> PNTransition :
@@ -527,7 +586,10 @@ def subscription_changed(self, event: events.SubscriptionChangedEvent, context:
527586
528587 return PNTransition (
529588 state = ReceiveReconnectingState ,
530- context = self ._context
589+ context = self ._context ,
590+ invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNSubscriptionChangedCategory ,
591+ operation = PNOperationType .PNSubscribeOperation ,
592+ context = self ._context )
531593 )
532594
533595 def disconnect (self , event : events .DisconnectEvent , context : PNContext ) -> PNTransition :
@@ -602,7 +664,10 @@ def subscription_changed(self, event: events.SubscriptionChangedEvent, context:
602664
603665 return PNTransition (
604666 state = ReceivingState ,
605- context = self ._context
667+ context = self ._context ,
668+ invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNSubscriptionChangedCategory ,
669+ operation = PNOperationType .PNSubscribeOperation ,
670+ context = self ._context )
606671 )
607672
608673 def reconnect (self , event : events .ReconnectEvent , context : PNContext ) -> PNTransition :
@@ -637,8 +702,14 @@ def unsubscribe_all(self, event: events.UnsubscribeAllEvent, context: PNContext)
637702 return PNTransition (
638703 state = UnsubscribedState ,
639704 context = self ._context ,
640- invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNAcknowledgmentCategory ,
641- operation = PNOperationType .PNUnsubscribeOperation )
705+ invocation = [
706+ invocations .EmitStatusInvocation (PNStatusCategory .PNDisconnectedCategory ,
707+ operation = PNOperationType .PNSubscribeOperation ,
708+ context = self ._context ),
709+ invocations .EmitStatusInvocation (PNStatusCategory .PNAcknowledgmentCategory ,
710+ operation = PNOperationType .PNSubscribeOperation ,
711+ context = self ._context ),
712+ ]
642713 )
643714
644715
@@ -671,8 +742,14 @@ def unsubscribe_all(self, event: events.UnsubscribeAllEvent, context: PNContext)
671742 return PNTransition (
672743 state = UnsubscribedState ,
673744 context = self ._context ,
674- invocation = invocations .EmitStatusInvocation (PNStatusCategory .PNAcknowledgmentCategory ,
675- operation = PNOperationType .PNUnsubscribeOperation )
745+ invocation = [
746+ invocations .EmitStatusInvocation (PNStatusCategory .PNDisconnectedCategory ,
747+ operation = PNOperationType .PNSubscribeOperation ,
748+ context = self ._context ),
749+ invocations .EmitStatusInvocation (PNStatusCategory .PNAcknowledgmentCategory ,
750+ operation = PNOperationType .PNSubscribeOperation ,
751+ context = self ._context ),
752+ ]
676753 )
677754
678755
0 commit comments