PlatformWorkerRunCommand
extends Command
in package
Runs one bounded platform schedule and queue worker cycle.
Table of Contents
Constants
- ADVISORY_LOCK_KEY : mixed = 'kmp:platform-worker'
Properties
- $platformConnection : Connection|null
- $workerService : PlatformWorkerService|null
Methods
- __construct() : mixed
- defaultName() : string
- execute() : int
- buildOptionParser() : ConsoleOptionParser
- acquireWorkerLock() : bool
- Acquire the process-wide worker lock when PostgreSQL is available.
- failureCount() : int
- releaseWorkerLock() : void
- Release the process-wide worker lock when PostgreSQL is available.
Constants
ADVISORY_LOCK_KEY
private
mixed
ADVISORY_LOCK_KEY
= 'kmp:platform-worker'
Properties
$platformConnection read-only
private
Connection|null
$platformConnection
= null
$workerService read-only
private
PlatformWorkerService|null
$workerService
= null
Methods
__construct()
public
__construct([PlatformWorkerService|null $workerService = null ][, Connection|null $platformConnection = null ]) : mixed
Parameters
- $workerService : PlatformWorkerService|null = null
-
Worker orchestrator
- $platformConnection : Connection|null = null
-
Optional platform connection override
defaultName()
public
static defaultName() : string
Tags
Return values
stringexecute()
public
execute(Arguments $args, ConsoleIo $io) : int
Parameters
- $args : Arguments
- $io : ConsoleIo
Tags
Return values
intbuildOptionParser()
protected
buildOptionParser(ConsoleOptionParser $parser) : ConsoleOptionParser
Parameters
- $parser : ConsoleOptionParser
Tags
Return values
ConsoleOptionParseracquireWorkerLock()
Acquire the process-wide worker lock when PostgreSQL is available.
private
acquireWorkerLock(Connection $connection) : bool
Parameters
- $connection : Connection
Return values
boolfailureCount()
private
failureCount(array<string, mixed> $result) : int
Parameters
- $result : array<string, mixed>
-
Worker result
Return values
intreleaseWorkerLock()
Release the process-wide worker lock when PostgreSQL is available.
private
releaseWorkerLock(Connection $connection) : void
Parameters
- $connection : Connection