PHP code example of ch1p / jobd-client
1. Go to this page and download the library: Download ch1p/jobd-client library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ch1p / jobd-client example snippets
try {
$jobd = new jobd\MasterClient();
} catch (\jobd\exceptions\JobdException $e) {
die("Failed to connect.\n");
}
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 (\jobd\exceptions\JobdException $e) {
die('jobd error: '.$e->getMessage()."\n");
}
$jobd->close();