ch1p/jobd-client

Installs: 203

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/ch1p/jobd-client

1.6.1 2023-10-08 01:47 UTC

This package is auto-updated.

Last update: 2025-10-08 06:28:24 UTC


README

This is a simple PHP client for 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 WorkerClient.php, MasterClient.php and Client.php.

Here's a small example.

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();

License

BSD-2c