From e717389fdea051757335511aa8bec97cd93471bd Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Tue, 16 Mar 2021 01:02:08 +0300 Subject: WorkerClient: support addTarget() and removeTarget() --- src/WorkerClient.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/WorkerClient.php b/src/WorkerClient.php index 8b979af..2773de5 100644 --- a/src/WorkerClient.php +++ b/src/WorkerClient.php @@ -48,6 +48,36 @@ class WorkerClient extends Client { ); } + /** + * @param string $target + * @param int $concurrency + * @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 -- cgit v1.2.3