Main task queue.
Tags for scheduled tasks.
protected bool $reconnect = true
public __construct(?string $configFile, string $env = 'development'): void
| Parameter | Type | Description |
|---|
$configFile | string | |
$env | string | |
Returns the agent configuration.
public getConfig(): Config
public setSilent(bool $silent = true): void
| Parameter | Type | Description |
|---|
$silent | bool | |
public createConnection(Protocol $protocol, ?string $guid): Connection
| Parameter | Type | Description |
|---|
$protocol | Protocol | |
$guid | string | |
public registerServices(string $configFile = 'services'): void
| Parameter | Type | Description |
|---|
$configFile | string | |
Registers scheduled tasks based on the provided configuration array.
public registerScheduledTasks(array $scheduleConfig): void
Iterates through each task in the schedule configuration, validates the presence of the 'action' attribute, creates an Endpoint for the action, sets parameters if provided, and schedules the task to run at the specified time. Handles special scheduling keyword '@reboot' by calculating the appropriate start time with an optional boot delay. Logs notices and errors for missing or invalid configuration attributes.
| Parameter | Type | Description |
|---|
$scheduleConfig | array | |
Registers event handlers based on the provided configuration array.
public registerEventHandlers(array $eventConfig): void
Iterates through each event in the event configuration, creates an Endpoint for the handler, and subscribes to the event with the corresponding handler. Logs notices and errors for invalid configuration attributes.
| Parameter | Type | Description |
|---|
$eventConfig | array | array of event configurations where the key is the event name and the value is the handler (callable) |
public trigger(string $event, mixed $data, bool $echoSelf): bool
| Parameter | Type | Description |
|---|
$event | string | |
$data | mixed | |
$echoSelf | bool | |
protected processCommand(PacketType $command, ?\stdClass $payload): bool
| Parameter | Type | Description |
|---|
$command | PacketType | |
$payload | \stdClass | |
private processEvent(string $event, mixed $payload): void
| Parameter | Type | Description |
|---|
$event | string | |
$payload | mixed | |
private scheduleRunner(string $when, Endpoint $endpoint, mixed $args, ?string $tag, bool $overwrite): string
| Parameter | Type | Description |
|---|
$when | string | |
$endpoint | Endpoint | |
$args | mixed | |
$tag | string | |
$overwrite | bool | |
private taskQueueAdd(Task $task): void
| Parameter | Type | Description |
|---|
$task | Task | |
private taskCancel(string $taskID): bool
| Parameter | Type | Description |
|---|
$taskID | string | |
Generated by Hazaar API Doc Generator on Sun, 01 Mar 2026 09:22:26 +0000