You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `Client` is responsible for assembling and sending HTTP requests to the Docker API.
73
+
It requires a `Browser` object bound to the main `EventLoop` in order to handle async requests and a base URL.
74
+
The recommended way to create a `Client` is using the `Factory` (see above).
75
+
76
+
All public methods on the `Client` resemble the API described in the [Remote API documentation](https://docs.docker.com/reference/api/docker_remote_api_v1.15/) like this:
Listing all available commands is out of scope here, please refer to the [Remote API documentation](https://docs.docker.com/reference/api/docker_remote_api_v1.15/) or the class outline.
94
+
95
+
Sending requests is async (non-blocking), so you can actually send multiple requests in parallel.
96
+
Docker will respond to each request with a response message, the order is not guaranteed.
97
+
Sending requests uses a [Promise](https://github.com/reactphp/promise)-based interface that makes it easy to react to when a request is fulfilled (i.e. either successfully resolved or rejected with an error):
98
+
99
+
```php
100
+
$client->version()->then(
101
+
function ($result) {
102
+
var_dump('Result received', $result);
103
+
},
104
+
function (Exception $error) {
105
+
var_dump('There was an error', $error->getMessage());
106
+
}
107
+
});
108
+
```
109
+
26
110
## Install
27
111
28
112
The recommended way to install this library is [through composer](http://getcomposer.org). [New to composer?](http://getcomposer.org/doc/00-intro.md)
0 commit comments