diff options
Diffstat (limited to 'src/WorkerClient.php')
-rw-r--r-- | src/WorkerClient.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/WorkerClient.php b/src/WorkerClient.php new file mode 100644 index 0000000..4e221df --- /dev/null +++ b/src/WorkerClient.php @@ -0,0 +1,42 @@ +<?php + +namespace jobd; + +class WorkerClient extends Client { + + /** + * @return ResponseMessage + * @throws \Exception + */ + public function status(): ResponseMessage + { + return $this->recv( + $this->sendRequest(new RequestMessage('status')) + ); + } + + /** + * @param string[] $targets + * @return ResponseMessage + * @throws \Exception + */ + public function poll(array $targets): ResponseMessage + { + return $this->recv( + $this->sendRequest(new RequestMessage('poll', ['targets' => $targets])) + ); + } + + /** + * @param int[] $ids + * @return ResponseMessage + * @throws \Exception + */ + public function runManual(array $ids): ResponseMessage + { + return $this->recv( + $this->sendRequest(new RequestMessage('run-manual', ['ids' => $ids])) + ); + } + +}
\ No newline at end of file |