-
Notifications
You must be signed in to change notification settings - Fork 56
Add documentation for async client #21
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
Conversation
@@ -37,6 +37,30 @@ class MyClass | |||
} | |||
``` | |||
|
|||
## HTTP Async Client Discovery | |||
|
|||
This type of discovery finds installed HTTP Async Clients. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets say "a HttpAsyncClient" instance. from the point of the user, it only finds one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so "finds an installed HttpAsyncClient" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would leave out "installed", seems obvious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated other lines as well to make it consistent
@@ -19,7 +19,7 @@ composer require "php-http/discovery" | |||
|
|||
## HTTP Client Discovery | |||
|
|||
This type of discovery finds installed HTTP Clients. | |||
This type of discovery finds a HTTPClient implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about writing this as HTTPClient - maybe with a space, so "HTTP client"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for Http Async Client (to be consistent) ?
When using an asynchronous client, it will use a PSR-7 `RequestInterface` and returns a `Http\Client\Promise` : | ||
|
||
```php | ||
$httpAsyncClient = new HttpAsyncClientImplementation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have discovery for this? should we, if we don't have currently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do. I think I merged it today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then the tutorial should use it i think, instead of this line which can't be executed in reality (you would need to know your real client/adapter class name and use that instead)
Despite the namespace thing is there any more thing to change for this ? poke @dbu @sagikazarmark |
@@ -19,7 +19,7 @@ composer require "php-http/discovery" | |||
|
|||
## HTTP Client Discovery | |||
|
|||
This type of discovery finds installed HTTP Clients. | |||
This type of discovery finds a HTTP Client implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aN HTTP Client
Added a few comments, which are mostly about some grammar and formatting issues. Apart from that, 👍 |
|
||
This promise allows you to : | ||
|
||
* Add callbacks for when the response is available or an errors happens by using the then method: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the part that comes after this bullet is very long. lets maybe do an overview list and then subsections with the code examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't catch it. You are right.
great! |
Related to php-http/httplug#77