Skip to content

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

Merged
merged 4 commits into from
Nov 9, 2015
Merged

Add documentation for async client #21

merged 4 commits into from
Nov 9, 2015

Conversation

joelwurtz
Copy link
Member

Related to php-http/httplug#77

@@ -37,6 +37,30 @@ class MyClass
}
```

## HTTP Async Client Discovery

This type of discovery finds installed HTTP Async Clients.
Copy link
Contributor

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.

Copy link
Member Author

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" ?

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 leave out "installed", seems obvious

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 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.
Copy link
Contributor

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"?

Copy link
Member

Choose a reason for hiding this comment

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

Agree

Copy link
Member Author

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();
Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Contributor

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)

@joelwurtz
Copy link
Member Author

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.
Copy link
Member

Choose a reason for hiding this comment

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

aN HTTP Client

@sagikazarmark
Copy link
Member

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:
Copy link
Contributor

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.

Copy link
Member

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.

dbu added a commit that referenced this pull request Nov 9, 2015
Add documentation for async client
@dbu dbu merged commit ae9d39c into php-http:master Nov 9, 2015
@dbu
Copy link
Contributor

dbu commented Nov 9, 2015

great!

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.

3 participants