Skip to content

Add documentation for HTTP Client router #103

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

Merged
merged 1 commit into from
Sep 6, 2016
Merged

Conversation

sagikazarmark
Copy link
Member

No description provided.

and sent using the appropriate client. If there is no matching client, an exception is thrown.

This allows to inject a single client into multiple services,
but under the hood there can be clients configured for each of them::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/there can be clients configured for each of them/, different clients can be used for different requests/

i think the injecting into multiple services is not the only use case. it is useful even if a single service should use different clients for different urls. maybe with a special plugin to work around server bugs, or only authenticating requests to a protected sub-path but not to the public part of an api...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the injecting into multiple services is not the only use case

It was one use case I though of, but there are of course other use cases as well. I think we should pick the two or three most common onces.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would first say the generic thing, and then have a new sentence with some examples what this allows to do.

@dbu
Copy link
Contributor

dbu commented Jul 26, 2016

this looks stale. can we wrap this up, mark?

@sagikazarmark
Copy link
Member Author

I will try to find some time for this during the weekend.

@dbu
Copy link
Contributor

dbu commented Aug 12, 2016

ping ;-)

@sagikazarmark
Copy link
Member Author

Improved the example and added a note about the PluginClient. Not sure if it is better this way though.

HTTP Client Router
------------------

This client accepts pairs of clients (both sync and async) and request matchers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(both sync and async)
Is that needed? It makes the sentence harder to read.

@sagikazarmark sagikazarmark force-pushed the http_client_router branch 2 times, most recently from 96147d2 to d24a98c Compare August 14, 2016 17:12
@sagikazarmark
Copy link
Member Author

Any more comments?

/** @var \Psr\Cache\CacheItemPoolInterface $pool */
$pool...
/** @var \Http\Message\StreamFactory $streamFactory */
$streamFactory...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$pool = ...
$streamFactory = ..

@Nyholm
Copy link
Member

Nyholm commented Aug 16, 2016

I had a minor comment, But Im good to merge with or without that fix.

Thank you

@sagikazarmark
Copy link
Member Author

Anything else here?

@joelwurtz
Copy link
Member

Nope (or not ATM)

@joelwurtz joelwurtz merged commit fa6a0c2 into master Sep 6, 2016
@joelwurtz joelwurtz deleted the http_client_router branch September 6, 2016 13:05
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

Successfully merging this pull request may close these issues.

4 participants