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
In order to have correct behavior over the global process, you need to understand well each plugin used,
103
103
and manage a correct order when passing the array to the `PluginClient`
104
104
105
-
`RetryPlugin` will be best at then for example if you want to optimize the retry process, but also it can be good
106
-
to have it in the first plugin, if one is inconsistent and may need a retry.
105
+
`RetryPlugin` will be best at the end to optimize the retry process, but it can also be good
106
+
to have it as the first plugin, if one in the chain is inconsistent and may need a retry.
107
107
108
-
Our recommendation, which apply to most of the use case, is to organize your plugins with the following rule:
108
+
Our recommendation, which apply to most of use cases, is to organize your plugins with following rules:
109
109
110
110
1. Plugins that modify the request should be at the beginning (like the `AuthenticationPlugin` or the `CookiePlugin`)
111
111
2. Plugins which intervene in the workflow should be in the "middle" (like the `RetryPlugin` or the `RedirectPlugin`)
@@ -180,7 +180,7 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
180
180
In this example the condition is not superfluous, you need to have some way to not calling the $first callable each time or
181
181
you will end up with a infinite execution loop.
182
182
183
-
The `$next` and `$first` callable will return a `Promise`, you can manipulate the `ResponseInterface` or the `Exception`
183
+
The `$next` and `$first` callable will return a `Promise`. You can manipulate the `ResponseInterface` or the `Exception`
184
184
by using the `then` method of the promise.
185
185
186
186
```
@@ -199,4 +199,4 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
199
199
```
200
200
201
201
Anyway it is always a good practice to read existing implementation inside the [plugin repository](https://github.com/php-http/plugins) to better understand the whole
0 commit comments