Reference

PHP API

Native PHP functions exposed by the Pogo FrankenPHP plugins.

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:

CodeMeaning
0Queue full
1Accepted
2Worker unavailable
3Payload too large
4Queue shutting down
5Backend failure
6Queue 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:

CodeMeaning
0Success
1Hub missing
2Channel too long
3Event too long
4Payload too large
5Invalid payload JSON
6Broker publish failed
7Invalid multi-channel JSON
8Broker queue full
9Shard queue full