File tree Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ use ApiClients \Client \Supervisord \Client ;
4+ use function ApiClients \Foundation \resource_pretty_print ;
5+
6+ require dirname (__DIR__ ) . DIRECTORY_SEPARATOR . 'vendor/autoload.php ' ;
7+
8+ $ client = Client::create (require __DIR__ . DIRECTORY_SEPARATOR . 'resolve_host.php ' );
9+
10+ $ program = current ($ client ->programs ());
11+ resource_pretty_print ($ program );
12+ $ program ->disable ();
13+ $ program = $ program ->refresh ();
14+ resource_pretty_print ($ program );
15+ $ program ->enable ();
16+ $ program = $ program ->refresh ();
17+ resource_pretty_print ($ program );
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ use ApiClients \Client \Supervisord \Client ;
4+ use React \EventLoop \Factory ;
5+ use function ApiClients \Foundation \resource_pretty_print ;
6+
7+ require dirname (__DIR__ ) . DIRECTORY_SEPARATOR . 'vendor/autoload.php ' ;
8+
9+ $ loop = Factory::create ();
10+ $ client = Client::create (require __DIR__ . DIRECTORY_SEPARATOR . 'resolve_host.php ' );
11+
12+ $ program = current ($ client ->programs ());
13+ resource_pretty_print ($ program );
14+ resource_pretty_print ($ program ->restart ());
Original file line number Diff line number Diff line change 99
1010foreach ($ client ->programs () as $ program ) {
1111 resource_pretty_print ($ program );
12+ resource_pretty_print ($ program ->refresh ());
1213}
Original file line number Diff line number Diff line change @@ -14,4 +14,25 @@ public function refresh(): Program
1414 return $ program ->refresh ();
1515 }));
1616 }
17+
18+ public function enable (): bool
19+ {
20+ return $ this ->wait ($ this ->handleCommand (new BuildAsyncFromSyncCommand (self ::HYDRATE_CLASS , $ this ))->then (function (ProgramInterface $ program ) {
21+ return $ program ->enable ();
22+ }));
23+ }
24+
25+ public function disable (): bool
26+ {
27+ return $ this ->wait ($ this ->handleCommand (new BuildAsyncFromSyncCommand (self ::HYDRATE_CLASS , $ this ))->then (function (ProgramInterface $ program ) {
28+ return $ program ->disable ();
29+ }));
30+ }
31+
32+ public function restart (): Program
33+ {
34+ return $ this ->wait ($ this ->handleCommand (new BuildAsyncFromSyncCommand (self ::HYDRATE_CLASS , $ this ))->then (function (ProgramInterface $ program ) {
35+ return $ program ->restart ();
36+ }));
37+ }
1738}
You can’t perform that action at this time.
0 commit comments