Documentation

LocalActivityOptions extends Options
in package
implements ActivityOptionsInterface

LocalActivityOptions stores all local activity-specific parameters that will be stored inside of a context.

The current timeout resolution implementation is in seconds and uses ceil($interval->s) as the duration. But is subjected to change in the future.

Tags
psalm-import-type

DateIntervalValue from DateInterval

Table of Contents

Interfaces

ActivityOptionsInterface
A marker interface for ActivityOptions and LocalActivityOptions

Properties

$retryOptions  : RetryOptions|null
RetryPolicy specifies how to retry an Activity if an error occurs.
$scheduleToCloseTimeout  : DateInterval
The end to end timeout for the activity needed. The zero value of this uses default value.
$startToCloseTimeout  : DateInterval
The timeout from the start of execution to end of it.

Methods

__construct()  : mixed
ActivityOptions constructor.
mergeWith()  : $this
withRetryOptions()  : $this
withScheduleToCloseTimeout()  : $this
Overall timeout workflow is willing to wait for activity to complete.
withStartToCloseTimeout()  : $this
Maximum activity execution time after it was sent to a worker. If schedule to close is not provided then both this and schedule to start are required.

Properties

$retryOptions

RetryPolicy specifies how to retry an Activity if an error occurs.

public RetryOptions|null $retryOptions = null

More details are available at . RetryPolicy is optional. If one is not specified a default RetryPolicy is provided by the server.

The default RetryPolicy provided by the server specifies:

  • InitialInterval of 1 second
  • BackoffCoefficient of 2.0
  • MaximumInterval of 100 x InitialInterval
  • MaximumAttempts of 0 (unlimited)

To disable retries set MaximumAttempts to 1. The default RetryPolicy provided by the server can be overridden by the dynamic config.

$scheduleToCloseTimeout

The end to end timeout for the activity needed. The zero value of this uses default value.

public DateInterval $scheduleToCloseTimeout

Optional: The default value is the sum of $scheduleToStartTimeout and $startToCloseTimeout.

$startToCloseTimeout

The timeout from the start of execution to end of it.

public DateInterval $startToCloseTimeout

Methods

withScheduleToCloseTimeout()

Overall timeout workflow is willing to wait for activity to complete.

public withScheduleToCloseTimeout(DateIntervalValue $timeout) : $this

It includes activity execution time:

  • Use ActivityOptions::withStartToCloseTimeout($timeout) to limit it.

Either this option or both schedule to start and start to close are required.

Parameters
$timeout : DateIntervalValue
Tags
psalm-suppress

ImpureMethodCall

Return values
$this

withStartToCloseTimeout()

Maximum activity execution time after it was sent to a worker. If schedule to close is not provided then both this and schedule to start are required.

public withStartToCloseTimeout(DateIntervalValue $timeout) : $this
Parameters
$timeout : DateIntervalValue
Tags
psalm-suppress

ImpureMethodCall

Return values
$this

        
On this page

Search results