Skip to content

v2.19

Latest

Choose a tag to compare

@xepozz xepozz released this 16 Sep 10:44
· 10 commits to master since this release
a5aa7bc

Temporal PHP SDK v2.19

A small release: a client for the Temporal Cloud Operations API, an opt-in change to multi-condition await, and a set of correctness, including compatibility fixes for ext-protobuf 3.x and performance improvements.


Features

Cloud Operations API Client

PR: #797
Author: @xepozz

A CloudClient / CloudClientInterface pair exposes the Cloud Operations API
through the SDK's own gRPC abstraction, so it shares connection handling, metadata, interceptors,
retries and call context with WorkflowClient and OperatorClient.

withApiVersion() pins the required temporal-cloud-api-version header on every call; a version
already present on the call context wins.

use Temporal\Api\Cloud\Cloudservice\V1\GetNamespacesRequest;
use Temporal\Client\GRPC\CloudClient;

$cloud = CloudClient::createSSL('saas-api.tmprl.cloud:443')
    ->withAuthKey($apiKey)
    ->withApiVersion('2024-05-13-00');

$response = $cloud->GetNamespaces(new GetNamespacesRequest());

The stubs come from the CloudService gRPC definitions shipped in roadrunner-api-dto 1.15.0,
so the package constraint moves to ^1.15.0.

Closes #476.


Settle await() on the First Settled Condition

PR: #785
Author: @xepozz

A rejected promise passed to a multi-condition Workflow::await() / awaitWithTimeout() used to be
swallowed until the timeout fired. With the new flag the await unblocks on the first settled
condition and propagates the rejection (Promise::any → Promise::race); the pending internal
timer of awaitWithTimeout() is cancelled on that path too.

Because this changes the commands a workflow emits, it is gated behind a feature flag — default off
keeps existing histories replay-compatible, mirroring sdk-java's CANCEL_AWAIT_TIMER_ON_CONDITION.

\Temporal\Worker\FeatureFlags::$settleAwaitOnFirstSettledCondition = true;

// $activityPromise rejects -> the await rejects immediately instead of waiting for the timeout
yield Workflow::awaitWithTimeout('10 minutes', $activityPromise, fn(): bool => $this->done);

To wait for the first fulfilled condition and keep ignoring rejections, combine the promises
explicitly: yield Workflow::await(Promise::any([$a, $b])).

Closes #399.


Others improvements and fixes

  • #804 – fix: unwrap protobuf repeated fields from the C extension (@xepozz)
  • #806 – perf(loop): drain the once-callback queue of a loop layer in linear instead of quadratic time (@xepozz)
  • #807 – fix(testing): a readiness check that answers slower than its one second timeout no longer aborts the run (@xepozz)
  • #809 - test(unit): name the eleven orphaned unit test files TestCase so the Unit suite picks them up (@xepozz)

Full Changelog

v2.18...v2.19