@@ -44,7 +44,7 @@ See also the [examples](examples).
44
44
45
45
### Factory
46
46
47
- The ` Factory ` class is responsible for constructing the [ ` Client ` ] [ #client ] instance.
47
+ The ` Factory ` class is responsible for constructing the [ ` Client ` ] ( #client ) instance.
48
48
It also registers everything with the main [ ` EventLoop ` ] ( https://github.com/reactphp/event-loop#usage ) .
49
49
50
50
``` php
@@ -73,26 +73,38 @@ Only `user` and `pass` have to be set explicitly, the `Factory` assumes defaults
73
73
74
74
The ` Client ` class is responsible for communication with the remote SolusVM API.
75
75
76
- #### reboot()
76
+ #### Actions
77
77
78
- The ` reboot() ` method can be used to reboot your VPS .
78
+ All public methods resemble their respective SolusVM Client API actions .
79
79
80
- #### boot()
81
-
82
- The ` boot() ` method can be used to boot your VPS.
83
-
84
- #### shutdown()
80
+ ``` php
81
+ $client->reboot();
82
+ $client->boot();
83
+ $client->shutdown();
85
84
86
- The ` shutdown() ` method can be used to shutdown your VPS.
85
+ $client->status();
86
+ $client->info($ipaddr = true, $hdd = true, $mem = true, $bw = true);
87
+ ```
87
88
88
- #### status()
89
+ Listing all available actions is out of scope here, please refer to the [ class outline ] ( src/Client.php ) .
89
90
90
- The ` status() ` method can be used to get the status (online/offline) of your VPS.
91
+ #### Processing
91
92
92
- #### info()
93
+ Issuing actions is async (non-blocking), so you can actually send multiple action requests in parallel.
94
+ The SolusVM API service will respond to each request with a response value. The order is not guaranteed.
95
+ Sending requests uses a [ Promise] ( https://github.com/reactphp/promise ) -based interface that makes it easy to react to when a request is * fulfilled*
96
+ (i.e. either successfully resolved or rejected with an error):
93
97
94
- The ` info($ipaddr = true, $hdd = true, $mem = true, $bw = true) ` method can be used to retrieve
95
- some information about your VPS.
98
+ ``` php
99
+ $client->status()->then(
100
+ function ($result) {
101
+ // response received for status action
102
+ },
103
+ function (Exception $e) {
104
+ // an error occured while executing the status action
105
+ }
106
+ });
107
+ ```
96
108
97
109
## Install
98
110
0 commit comments