public static function Proxy::wrapSync in Lockr 7.3
Sends synchronous requests to a specific handler while sending all other requests to another handler.
Parameters
callable $default Handler used for normal responses:
callable $sync Handler used for synchronous responses.:
Return value
callable Returns the composed handler.
1 call to Proxy::wrapSync()
- choose_handler in vendor/
guzzlehttp/ guzzle/ src/ functions.php - Chooses and creates a default handler to use based on the environment.
File
- vendor/
guzzlehttp/ guzzle/ src/ Handler/ Proxy.php, line 21
Class
- Proxy
- Provides basic proxies for handlers.
Namespace
GuzzleHttp\HandlerCode
public static function wrapSync(callable $default, callable $sync) {
return function (RequestInterface $request, array $options) use ($default, $sync) {
return empty($options[RequestOptions::SYNCHRONOUS]) ? $default($request, $options) : $sync($request, $options);
};
}