PlatformWorkerService
in package
Runs one bounded scheduler and queue cycle for a fleet worker execution.
Table of Contents
Properties
- $clock : Closure
- $platformJobRunner : PlatformJobRunner
- $queueDrainService : PlatformQueueDrainService
- $scheduleRunner : PlatformScheduleRunner
Methods
- __construct() : mixed
-
run()
: array{schedules: array{schedules: int, completed: int, failed: int, jobsCreated: int}, queues: array{default: int, tenants: array
, failures: array , duplicateTenants: list , deferredTenants: list , datasourcesProcessed: int, jobsProcessed: int, elapsedMs: float}, platformJobs: array{claimed: int, completed: int, failed: int}, errors: array , summary: array{schedulesDispatched: int, datasourcesProcessed: int, queueJobsProcessed: int, platformJobsCompleted: int, platformJobsFailed: int}, elapsedMs: float}
Properties
$clock read-only
private
Closure
$clock
$platformJobRunner read-only
private
PlatformJobRunner
$platformJobRunner
$queueDrainService read-only
private
PlatformQueueDrainService
$queueDrainService
$scheduleRunner read-only
private
PlatformScheduleRunner
$scheduleRunner
Methods
__construct()
public
__construct(PlatformScheduleRunner $scheduleRunner, PlatformQueueDrainService $queueDrainService, PlatformJobRunner $platformJobRunner[, Closure|null $clock = null ]) : mixed
Parameters
- $scheduleRunner : PlatformScheduleRunner
-
Timed schedule dispatcher
- $queueDrainService : PlatformQueueDrainService
-
Fleet queue processor
- $platformJobRunner : PlatformJobRunner
-
Platform job processor
- $clock : Closure|null = null
-
Optional monotonic clock returning seconds
run()
public
run(int $scheduleLimit, int $maxJobs, int $maxRuntimeSeconds, int $cycleBudgetSeconds, int $platformLimit, callable $commandRunner) : array{schedules: array{schedules: int, completed: int, failed: int, jobsCreated: int}, queues: array{default: int, tenants: array, failures: array, duplicateTenants: list, deferredTenants: list, datasourcesProcessed: int, jobsProcessed: int, elapsedMs: float}, platformJobs: array{claimed: int, completed: int, failed: int}, errors: array, summary: array{schedulesDispatched: int, datasourcesProcessed: int, queueJobsProcessed: int, platformJobsCompleted: int, platformJobsFailed: int}, elapsedMs: float}
Parameters
- $scheduleLimit : int
- $maxJobs : int
- $maxRuntimeSeconds : int
- $cycleBudgetSeconds : int
- $platformLimit : int
- $commandRunner : callable
-
Callable receiving (object|string $command, list
$args): int|null