WorkflowContext
in package
FinalYes
Straight-line deterministic operations available while a workflow Fiber is replayed.
Table of Contents
Properties
- $runId : string
- $workflowId : string
- $cancellationRequested : bool
- $codec : PayloadCodec
- $execution : Fiber<mixed, mixed>|null
- $history : array<string|int, mixed>
Methods
- __construct() : mixed
- activity() : mixed
- childWorkflow() : mixed
- continueAsNew() : never
- isCancellationRequested() : bool
- sideEffect() : mixed
- signals() : array<int, array<int, mixed>>
- sleep() : void
- throwIfCancellationRequested() : void
- updates() : array<int, array<int, mixed>>
- upsertSearchAttributes() : void
- suspend() : mixed
Properties
$runId read-only
public
string
$runId
$workflowId read-only
public
string
$workflowId
$cancellationRequested read-only
private
bool
$cancellationRequested
= false
$codec read-only
private
PayloadCodec
$codec
$execution read-only
private
Fiber<mixed, mixed>|null
$execution
$history read-only
private
array<string|int, mixed>
$history
Methods
__construct()
public
__construct(string $workflowId, string $runId, array<int, array<string, mixed>> $history, PayloadCodec $codec[, bool $cancellationRequested = false ][, Fiber<mixed, mixed>|null $execution = null ]) : mixed
Parameters
- $workflowId : string
- $runId : string
- $history : array<int, array<string, mixed>>
- $codec : PayloadCodec
- $cancellationRequested : bool = false
- $execution : Fiber<mixed, mixed>|null = null
activity()
public
activity(string $activityType[, array<int, mixed> $arguments = [] ][, array<string, mixed> $options = [] ]) : mixed
Parameters
- $activityType : string
- $arguments : array<int, mixed> = []
- $options : array<string, mixed> = []
childWorkflow()
public
childWorkflow(string $workflowType[, array<int, mixed> $arguments = [] ][, array<string, mixed> $options = [] ]) : mixed
Parameters
- $workflowType : string
- $arguments : array<int, mixed> = []
- $options : array<string, mixed> = []
continueAsNew()
public
continueAsNew([array<int, mixed> $arguments = [] ][, string|null $workflowType = null ][, string|null $taskQueue = null ]) : never
Parameters
- $arguments : array<int, mixed> = []
- $workflowType : string|null = null
- $taskQueue : string|null = null
Return values
neverisCancellationRequested()
public
isCancellationRequested() : bool
Return values
boolsideEffect()
public
sideEffect(callable(): mixed $operation) : mixed
Parameters
- $operation : callable(): mixed
signals()
public
signals(string $signalName) : array<int, array<int, mixed>>
Parameters
- $signalName : string
Return values
array<int, array<int, mixed>>sleep()
public
sleep(int|float $seconds) : void
Parameters
- $seconds : int|float
throwIfCancellationRequested()
public
throwIfCancellationRequested() : void
updates()
public
updates(string $updateName) : array<int, array<int, mixed>>
Parameters
- $updateName : string
Return values
array<int, array<int, mixed>>upsertSearchAttributes()
public
upsertSearchAttributes(array<string, mixed> $attributes) : void
Parameters
- $attributes : array<string, mixed>
suspend()
private
suspend(WorkflowCommand $command) : mixed
Parameters
- $command : WorkflowCommand