@@ -95,8 +95,12 @@ async def _trigger(self, trigger_data: TriggerData):
9595
9696 event_data = EventData (trigger_data = trigger_data , transition = transition )
9797 args , kwargs = event_data .args , event_data .extended_kwargs
98- await self .sm ._get_callbacks (transition .validators .key ).async_call (* args , ** kwargs )
99- if not await self .sm ._get_callbacks (transition .cond .key ).async_all (* args , ** kwargs ):
98+ await self .sm ._callbacks_registry .async_call (
99+ transition .validators .key , * args , ** kwargs
100+ )
101+ if not await self .sm ._callbacks_registry .async_all (
102+ transition .cond .key , * args , ** kwargs
103+ ):
100104 continue
101105
102106 result = await self ._activate (event_data )
@@ -115,19 +119,21 @@ async def _activate(self, event_data: EventData):
115119 source = event_data .state
116120 target = transition .target
117121
118- result = await self .sm ._get_callbacks (transition .before .key ).async_call (* args , ** kwargs )
122+ result = await self .sm ._callbacks_registry .async_call (
123+ transition .before .key , * args , ** kwargs
124+ )
119125 if source is not None and not transition .internal :
120- await self .sm ._get_callbacks (source .exit .key ). async_call ( * args , ** kwargs )
126+ await self .sm ._callbacks_registry . async_call (source .exit .key , * args , ** kwargs )
121127
122- result += await self .sm ._get_callbacks (transition .on .key ). async_call ( * args , ** kwargs )
128+ result += await self .sm ._callbacks_registry . async_call (transition .on .key , * args , ** kwargs )
123129
124130 self .sm .current_state = target
125131 event_data .state = target
126132 kwargs ["state" ] = target
127133
128134 if not transition .internal :
129- await self .sm ._get_callbacks (target .enter .key ). async_call ( * args , ** kwargs )
130- await self .sm ._get_callbacks (transition .after .key ). async_call ( * args , ** kwargs )
135+ await self .sm ._callbacks_registry . async_call (target .enter .key , * args , ** kwargs )
136+ await self .sm ._callbacks_registry . async_call (transition .after .key , * args , ** kwargs )
131137
132138 if len (result ) == 0 :
133139 result = None
0 commit comments