diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2021-03-16 01:02:08 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2021-03-16 01:02:10 +0300 |
commit | e717389fdea051757335511aa8bec97cd93471bd (patch) | |
tree | 34eb55dfcae9647ffe08e7856408a0e440bc6356 | |
parent | 13119f21f8d7905ea041671150e7efe8f8d1de2b (diff) |
WorkerClient: support addTarget() and removeTarget()
-rw-r--r-- | src/WorkerClient.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/WorkerClient.php b/src/WorkerClient.php index 8b979af..2773de5 100644 --- a/src/WorkerClient.php +++ b/src/WorkerClient.php @@ -54,6 +54,36 @@ class WorkerClient extends Client { * @return ResponseMessage * @throws Exception */ + public function addTarget(string $target, int $concurrency): ResponseMessage + { + return $this->recv( + $this->sendRequest(new RequestMessage('add-target', [ + 'target' => $target, + 'concurrency' => $concurrency + ])) + ); + } + + /** + * @param string $target + * @return ResponseMessage + * @throws Exception + */ + public function removeTarget(string $target): ResponseMessage + { + return $this->recv( + $this->sendRequest(new RequestMessage('remove-target', [ + 'target' => $target + ])) + ); + } + + /** + * @param string $target + * @param int $concurrency + * @return ResponseMessage + * @throws Exception + */ public function setTargetConcurrency(string $target, int $concurrency): ResponseMessage { return $this->recv( |