README: improve example
This commit is contained in:
parent
3acf5bdba4
commit
ae9fd96175
16
README.md
16
README.md
@ -19,14 +19,18 @@ Here's a small example.
|
||||
try {
|
||||
$jobd = new jobd\Client(jobd\Client::MASTER_PORT, '127.0.0.1');
|
||||
} catch (Exception $e) {
|
||||
die('Failed to connect.');
|
||||
die("Failed to connect.\n");
|
||||
}
|
||||
|
||||
// poke master to send poll requests to workers
|
||||
$response = $jobd->poke(['target_name', 'another_name']);
|
||||
|
||||
// get status from master
|
||||
$response = $status = $jobd->status();
|
||||
try {
|
||||
// poke master to send poll requests to workers
|
||||
$response = $jobd->poke(['target_name', 'another_name']);
|
||||
|
||||
// get status from master
|
||||
$status = $jobd->status()->getData();
|
||||
} catch (Exception $e) {
|
||||
die('jobd error: '.$e->getMessage()."\n");
|
||||
}
|
||||
|
||||
$jobd->close();
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user