Namespaces used by the package:
LiquidRazor\\ProcessEvents\\Worker\\LiquidRazor\\ProcessEvents\\ExternalCall\\LiquidRazor\\ProcessEvents\\Metadata\\Worker\\LiquidRazor\\ProcessEvents\\Metadata\\ExternalCall\\
| Event | Constructor payload | Meaning |
|---|---|---|
WorkerSpawnedEvent |
WorkerIdentity |
A worker instance has been created and is now present in the runtime. |
WorkerStartedEvent |
WorkerIdentity |
The worker has entered active execution. |
WorkerFinishedEvent |
WorkerIdentity, WorkerTermination |
The worker completed normally. |
WorkerCrashedEvent |
WorkerIdentity, WorkerCrash |
The worker ended abnormally because of a crash or unrecoverable error. |
Worker metadata:
WorkerIdentityCarries the normalized worker id throughid().WorkerTerminationCarriesexitCode()and optionalsummaryMessage().WorkerCrashCarriesfailureClass(),message(), and optionalcode().
| Event | Constructor payload | Meaning |
|---|---|---|
ExternalCallStartedEvent |
ExternalCallDescriptor, ExternalCallTiming |
An outbound call attempt started. |
ExternalCallSucceededEvent |
ExternalCallDescriptor, ExternalCallTiming |
The call attempt completed successfully from the caller perspective. |
ExternalCallFailedEvent |
ExternalCallDescriptor, ExternalCallTiming, ExternalCallFailure |
The call attempt failed in a non-timeout, non-cancelled way. |
ExternalCallRetryRequestedEvent |
ExternalCallDescriptor, ExternalCallRetry |
A later layer decided another attempt should be made. |
ExternalCallRetriedEvent |
ExternalCallDescriptor, ExternalCallRetry |
A retry attempt was actually initiated. |
ExternalCallTimedOutEvent |
ExternalCallDescriptor, ExternalCallTiming, ExternalCallTimeout |
The call attempt was classified as a timeout. |
ExternalCallCancelledEvent |
ExternalCallDescriptor, ExternalCallCancellation |
The call attempt was intentionally cancelled. |
External call metadata:
CallIdentityStable logical call identifier exposed throughvalue().AttemptNumberPositive per-attempt number exposed throughvalue().ExternalCallReferenceCurrent attempt reference composed ofcallIdentity()andattemptNumber().ExternalTargetNormalized caller-side target system exposed throughsystem().ExternalOperationNormalized caller-side operation name exposed throughname().ExternalTransportNormalized protocol/transport identity exposed throughprotocol().ExternalCallDescriptorCompact descriptor that groupsreference(),target(),operation(), andtransport().ExternalCallTimingTiming data withstartedAt(), optionalfinishedAt(), and optionaldurationMilliseconds().ExternalCallFailureFailure classification withclassification(),message(), and optionalcode().ExternalCallRetryRetry metadata withnextAttemptNumber()and optionalreason().ExternalCallTimeoutTimeout metadata withtimeoutMilliseconds()and optionalclassification().ExternalCallCancellationCancellation metadata withreason()and optionalorigin().
External call modeling is intentionally split in two:
CallIdentityrepresents the logical outbound call across the full lifecycleAttemptNumberrepresents one execution attempt within that logical call
ExternalCallReference stores the current attempt. ExternalCallRetry stores the next attempt number. This keeps retry intent/execution distinct while preserving the logical call id across retries.
Worker completion:
<?php
declare(strict_types=1);
use LiquidRazor\ProcessEvents\Metadata\Worker\WorkerIdentity;
use LiquidRazor\ProcessEvents\Metadata\Worker\WorkerTermination;
use LiquidRazor\ProcessEvents\Worker\WorkerFinishedEvent;
$event = new WorkerFinishedEvent(
new WorkerIdentity('worker-17'),
new WorkerTermination(0, 'completed'),
);External call failure followed by retry request:
<?php
declare(strict_types=1);
use DateTimeImmutable;
use LiquidRazor\ProcessEvents\ExternalCall\ExternalCallFailedEvent;
use LiquidRazor\ProcessEvents\ExternalCall\ExternalCallRetryRequestedEvent;
use LiquidRazor\ProcessEvents\Metadata\ExternalCall\AttemptNumber;
use LiquidRazor\ProcessEvents\Metadata\ExternalCall\CallIdentity;
use LiquidRazor\ProcessEvents\Metadata\ExternalCall\ExternalCallDescriptor;
use LiquidRazor\ProcessEvents\Metadata\ExternalCall\ExternalCallFailure;
use LiquidRazor\ProcessEvents\Metadata\ExternalCall\ExternalCallReference;
use LiquidRazor\ProcessEvents\Metadata\ExternalCall\ExternalCallRetry;
use LiquidRazor\ProcessEvents\Metadata\ExternalCall\ExternalCallTiming;
use LiquidRazor\ProcessEvents\Metadata\ExternalCall\ExternalOperation;
use LiquidRazor\ProcessEvents\Metadata\ExternalCall\ExternalTarget;
use LiquidRazor\ProcessEvents\Metadata\ExternalCall\ExternalTransport;
$descriptor = new ExternalCallDescriptor(
new ExternalCallReference(new CallIdentity('call-42'), new AttemptNumber(1)),
new ExternalTarget('payments-api'),
new ExternalOperation('capture'),
new ExternalTransport('http'),
);
$timing = new ExternalCallTiming(
new DateTimeImmutable('2026-04-03T10:00:00+00:00'),
new DateTimeImmutable('2026-04-03T10:00:01+00:00'),
1000,
);
$failed = new ExternalCallFailedEvent(
$descriptor,
$timing,
new ExternalCallFailure('transport_failure', 'connection dropped', 'ECONNRESET'),
);
$retryRequested = new ExternalCallRetryRequestedEvent(
$descriptor,
new ExternalCallRetry(new AttemptNumber(2), 'transient failure'),
);