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);
        };
    }
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);
        };
    }
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 ) ; } ; }
Sends synchronous requests to a specific handler while sending all other
requests to another handler.

@param callable $default Handler used for normal responses
@param callable $sync    Handler used for synchronous responses.

@return callable Returns the composed handler.
Sends synchronous requests to a specific handler while sending all other requests to another handler .