PHP API
Queue
pogo_queue_push(string $queue, string $payload, int $delaySeconds = 0): string;
pogo_queue_ack(string $queue, string $deliveryId): int;
pogo_queue_release(string $queue, string $deliveryId, int $delaySeconds = 0): int;
pogo_queue_fail(string $queue, string $deliveryId, string $reason = ''): int;
pogo_queue_status(?string $queue = null): string;
pogo_queue_push() returns JSON:
{
"ok": true,
"id": "1700000000-0",
"code": 1
}
Failure responses include ok: false, a numeric code, and a human-readable message.
Queue result codes:
| Code | Meaning |
|---|---|
0 | Queue full |
1 | Accepted |
2 | Worker unavailable |
3 | Payload too large |
4 | Queue shutting down |
5 | Backend failure |
6 | Queue unknown |
pogo_queue_status() returns JSON with ready and per-queue metrics such as pending, delayed, reserved, failed, enqueued, acked, released, backend_errors, and max_payload_bytes.
pogo_queue(string $data): int remains available as a deprecated v1 compatibility helper for immediate dispatch to the default queue.
Scheduler
Pogo Scheduler has no PHP API. It is configured through the pogo_scheduler Caddy global option.
Pogo
pogo_dispatch(string $class, array $args = [], string $pool = 'default'): int;
pogo_await(int $handle, float $timeout = 5.0): mixed;
pogo_pool_size(string $pool = 'default'): int;
pogo_dispatch() returns a handle. pogo_await() waits for the handle and returns the decoded job result.
pogo_await() throws RuntimeException for invalid handles, timeouts, worker failures, and job exceptions.
WebSocket
pogo_websocket_publish(string $appId, string $channel, string $event, string $data): int;
pogo_websocket_broadcast_multi(string $appId, string $channels, string $event, string $data): int;
$data must be a JSON string. $channels for pogo_websocket_broadcast_multi() must be a JSON encoded array of channel names.
Return status codes:
| Code | Meaning |
|---|---|
0 | Success |
1 | Hub missing |
2 | Channel too long |
3 | Event too long |
4 | Payload too large |
5 | Invalid payload JSON |
6 | Broker publish failed |
7 | Invalid multi-channel JSON |
8 | Broker queue full |
9 | Shard queue full |