aboutsummaryrefslogtreecommitdiff
path: root/src/MasterClient.php
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-03-02 20:31:10 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-03-02 20:31:10 +0300
commitc2639092c69695f72753caf7eec90716579a58c6 (patch)
tree94b16533d37313ba120b62f3ec56d356f035d979 /src/MasterClient.php
parentc269f18cc8d77a939b74a4abaf886d5d423ff329 (diff)
create separate classes WorkerClient and MasterClient
Diffstat (limited to 'src/MasterClient.php')
-rw-r--r--src/MasterClient.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/MasterClient.php b/src/MasterClient.php
new file mode 100644
index 0000000..6a7902b
--- /dev/null
+++ b/src/MasterClient.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace jobd;
+
+class MasterClient extends Client {
+
+ /**
+ * @param array $targets
+ * @return ResponseMessage
+ * @throws \Exception
+ */
+ public function poke(array $targets): ResponseMessage
+ {
+ return $this->recv(
+ $this->sendRequest(new RequestMessage('poke', ['targets' => $targets]))
+ );
+ }
+
+ /**
+ * @return ResponseMessage
+ * @throws \Exception
+ */
+ public function status(): ResponseMessage
+ {
+ return $this->recv(
+ $this->sendRequest(new RequestMessage('status'))
+ );
+ }
+
+} \ No newline at end of file