aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-02-26 03:40:02 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-02-26 03:40:02 +0300
commitada8a13ce8a3410f4260601d213404bff5fa1cc7 (patch)
treea3ae5a714cf1fc5ebe5ce76175746b4b0c8a7abe /README.md
initial
Diffstat (limited to 'README.md')
-rw-r--r--README.md36
1 files changed, 36 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..80ab121
--- /dev/null
+++ b/README.md
@@ -0,0 +1,36 @@
+# php-jobd-client
+
+This is a simple PHP client for [jobd](https://github.com/gch1p/jobd). It can send
+requests and read responses to/from *jobd* and *jobd-master* instances.
+
+## Installation
+
+```
+composer require ch1p/jobd-client
+```
+
+## Usage
+
+The API is compact and simple, just read the code of `Client.php`.
+
+Here's a small example.
+
+```php
+try {
+ $jobd = new jobd\Client(jobd\Client::MASTER_PORT, '127.0.0.1');
+} catch (Exception $e) {
+ die('Failed to connect.');
+}
+
+// poke master to send poll requests to workers
+$response = $jobd->poke(['target_name', 'another_name']);
+
+// get status from master
+$response = $status = $jobd->status();
+
+$jobd->close();
+```
+
+## License
+
+BSD-2c \ No newline at end of file