For the complete documentation index, see llms.txt. This page is also available as Markdown.

Temporal.io

Temporal runs durable workflows and activities for long-running business operations.

Read more at official website.

RoadRunner includes a plugin to execute Temporal workflows and activities. Configure a Temporal worker.

Activate plugin via config:

rpc:
  listen: tcp://127.0.0.1:6001

server:
  command: "php worker.php"

temporal:
  address: "127.0.0.1:7233"
  worker_heartbeat_interval: 10s
  activities:
    num_workers: 10

logs:
  level: debug
  channels:
    temporal:
      level: error

Worker Heartbeats

The temporal.worker_heartbeat_interval option sets how often SDK workers report their state to the Temporal server. Use a duration from 1s through 60s. If the option is omitted or set to 0s, the SDK uses its default of 60s.

Positive intervals below 1s are clamped to 1s. Intervals above 60s are clamped to 60s. The plugin logs a warning when it clamps a value.

The plugin supplies host CPU and memory usage and the PHP SDK identity for these heartbeats. This option does not control activity heartbeats or the activity heartbeat timeout.

Custom Payload Converters

The plugin collects Go implementations of Temporal's converter.PayloadConverter interface from a custom RoadRunner build. Use data_converters to select converters by their Encoding() value and set their order:

This example requires a registered converter with the encoding json/custom. An unknown encoding fails initialization. If the list is empty or omitted, the plugin uses all registered converters. Set the list when converter order matters.

The composite converter tries the standard nil, byte, and Protobuf converters first. It then tries the selected custom converters, followed by the standard JSON converter. See the payload converter example.

Example

Integrated workflow server provides the ability to create very complex, long-running activities.

Read more at official website.

Last updated