aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-03-02 21:31:08 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-03-02 21:31:08 +0300
commit1e2bf773af6b4f95497997638ea97c5b17382ddd (patch)
tree776b732e05282041560f4bf2fcde24f1ea5b1dfa
parentde8477086a2c661b4cef9c351592145a4b9b3423 (diff)
MasterClient: support poll_workers argument of status() request
-rw-r--r--src/MasterClient.php9
-rw-r--r--src/WorkerClient.php4
2 files changed, 11 insertions, 2 deletions
diff --git a/src/MasterClient.php b/src/MasterClient.php
index 6a7902b..d2a8712 100644
--- a/src/MasterClient.php
+++ b/src/MasterClient.php
@@ -4,6 +4,10 @@ namespace jobd;
class MasterClient extends Client {
+ public function __construct(int $port = Client::MASTER_PORT, ...$args) {
+ parent::__construct($port, ...$args);
+ }
+
/**
* @param array $targets
* @return ResponseMessage
@@ -17,13 +21,14 @@ class MasterClient extends Client {
}
/**
+ * @param bool $poll_workers
* @return ResponseMessage
* @throws \Exception
*/
- public function status(): ResponseMessage
+ public function status(bool $poll_workers = false): ResponseMessage
{
return $this->recv(
- $this->sendRequest(new RequestMessage('status'))
+ $this->sendRequest(new RequestMessage('status', ['poll_workers' => $poll_workers]))
);
}
diff --git a/src/WorkerClient.php b/src/WorkerClient.php
index 4e221df..dbf0f78 100644
--- a/src/WorkerClient.php
+++ b/src/WorkerClient.php
@@ -4,6 +4,10 @@ namespace jobd;
class WorkerClient extends Client {
+ public function __construct(int $port = Client::WORKER_PORT, ...$args) {
+ parent::__construct($port, ...$args);
+ }
+
/**
* @return ResponseMessage
* @throws \Exception