graze / guzzle-jsonrpc

JSON-RPC 2.0 client for Guzzle
https://packagist.org/packages/graze/guzzle-jsonrpc
MIT License
93 stars 61 forks source link

subscribers in factory #35

Closed h-bragg closed 6 years ago

h-bragg commented 6 years ago

Allow adding of subscribers during the Client::factory method.

This is used in a user of this, but it looks like it would have never worked. 🤷‍♂️

As the HttpClient is hidden from the user, the only options the user has is to attach the subscriber on every request. This makes it available to all requests.

Other options would be to provide some passthrough to the actual http client, or have an attachSubscriber method on the GuzzleClient object.