Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guzzle HTTP Client configuration #106

Open
hareku opened this issue Aug 24, 2020 · 1 comment
Open

Guzzle HTTP Client configuration #106

hareku opened this issue Aug 24, 2020 · 1 comment

Comments

@hareku
Copy link

hareku commented Aug 24, 2020

I really want to pass the configuration to Guzzle HTTP Client for setting timeout, and I have a proposal for that.

Add $clientOptions to the constructor of /src/Client/Server/Server.php

abstract class Server
{
    /**
     * @var array
     */
    protected $clientOptions;

    /**
     * Create a new server instance.
     *
     * @param ClientCredentialsInterface|array $clientCredentials
     * @param SignatureInterface               $signature
     * @param array  $clientOptions
     */
    public function __construct($clientCredentials, SignatureInterface $signature = null, $clientOptions)
@bencorlett
Copy link
Member

bencorlett commented Aug 28, 2020

I see what you're saying. I'm almost leaning to adding something like:

$server->resolveHttpClientUsing(function (): \GuzzleHttp\Client {
   // Return your client here
});

This would keep the signature the same as currently. Note: In the next major version, the client will be resolved externally to each server instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants