You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose we have two methods where one is interceptable and the another is an interceptor.
fromimagination.actionimportEventTypefromimagination.interceptionimportInterceptableMethod, CallableInterceptor@InterceptableMethod('interceptable_name_a')defmethod_a(x):
print(x)
@CallableInterceptor(EventType.PRE_CONDITION,'interceptable_name_a',options=[CallableInterceptor.RAISE_UNDEFINED_TARGET_EXCEPTION])defmethod_b(x):
print(
'It is greater than 10.'\
ifx>10else'It is less than 10.'
)
If method_a is executed, method_b should be executed before method_a while using the same parameters.
It also should work with any registered imagination.entity.Entity where the name of the interceptable point is the composition of the entity ID and the name of the method in the following pattern
entity_id.method_name
By default, CallableInterceptor will do nothing if the reference point of interception doesn't exist.
The text was updated successfully, but these errors were encountered:
Suppose we have two methods where one is interceptable and the another is an interceptor.
If
method_a
is executed,method_b
should be executed beforemethod_a
while using the same parameters.It also should work with any registered
imagination.entity.Entity
where the name of the interceptable point is the composition of the entity ID and the name of the method in the following patternBy default,
CallableInterceptor
will do nothing if the reference point of interception doesn't exist.The text was updated successfully, but these errors were encountered: