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
/* here we are describing formula, how next execution time should be calculated. Calculated amount will be added to current time */
44
44
"formula": [
45
45
{
46
-
"operator": "+",
47
46
/* here available *, -, + and / operators */
48
-
"argument": "QTY_TRIES"
47
+
"operator": "+",
49
48
/* you can use QTY_TRIES operator or any integer value */
49
+
"argument": "QTY_TRIES"
50
50
},
51
51
{
52
52
"operator": "*",
53
53
"argument": "5"
54
54
}
55
55
],
56
+
/* here you should define, what kind of transport you would use to deliver re-try messages to worker. Please pay your attention to https://github.com/apacheborys/re-try-php-basics-lib */
56
57
"transport": {
57
-
/* here you should define, what kind of transport you would use to deliver re-try messages to worker */
/* each specific executor could have own arguments in constructor. Here you should define it */
68
+
"arguments": []
69
69
}
70
70
}
71
71
}
72
72
}
73
-
```
73
+
```
74
+
75
+
The notice about `handlerExceptionDeclarator`, `transport` and `executor`:
76
+
77
+
As second argument for constructor of `ApacheBorys\Retry\ExceptionHandler` and `ApacheBorys\Retry\MessageHandler` you can send ContainerInterface. In this case, you can define arguments for `handlerExceptionDeclarator`, `transport` and `executor` as instances from runtime. It will be fetched from this injected Container.
Leading `@` indicates - you are trying to inject some instance from your container.
92
+
93
+
Also, if you don't want to use Container to inject some instances from runtime. But you still need to create some instances to ensure proper execution for `handlerExceptionDeclarator`, `transport` and `executor`, you can use next construction:
In this case, handler/declarator will try to instantiate described class with arguments. In these arguments you can use same tricks with leading `@`; and `class`, `arguments` constructions.
0 commit comments