Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Connection Management Layer
Issue #224
In the Service Client, a method
getConnection()
has been added, which returns aConnectionInterface
.ConnectionInterface
includes public methodsisConnected()
,disconnect()
,connect(float $timeout)
, allowingcontrol over the connection to the Temporal server.
A gRPC connection is lazy in PHP and is established only when the first gRPC method is called.
Using the
connect()
method, users can immediately establish and verify connection credentials without the need for gRPC method calls.Users can sequentially call
connect()
anddisconnect()
without causing errors related to closed gRPC channels, as the channels are recreated under the hood.Server Capabilities info now is cached in the Connection object and will be updated on each reconnect.
Service Client with Secure Connection
A deprecation error will now be triggered when a
ServiceClient
is created directly through the constructor. Static factories are the only recommended way to create aServiceClient
.One of such static methods has changes:
in
ServiceClient::createSSL()
, the root certificate parameter has been made optional because it should be skipped when connecting to the Temporal Cloud.All keys can be passed as a string payload (previously, only by file name was allowed). If the provided file cannot be read, a clear exception will be thrown.
New methods for all the Client (Workflow and Schedule)
Issue #338
Added new methods to WorkflowClient, ScheduleClient and ScheduleHandle:
withTimeout(float $timeout)
withDeadline()
withRetryOptions()
withMetadata()
They may be used before calling any method that sends a gRPC request to the server.
All the new methods are immutable and return a new instance of the client that will use the same connection as the original client, but with the specified timeout, deadline or retry options.
Note:
WorkflowClientInterface
andScheduleClientInterface
have been updated with the new methods.Namespace Inheritance in Client methods
A mistake was made in the implementation of several client functions last time: instead of using the Namespace value from ClientOptions, a parameter with the default value "default" was used.
This complicates the use of Temporal Cloud, where user's Namespace differs from "default".
Affected methods are:
WorkflowClient::listWorkflowExecutions()
WorkflowClient::countWorkflowExecutions()
WorkflowClient::getWorkflowHistory()
ScheduleClient::getHandle()
The
$namespace
parameter is nownull
by default. If a method receivesnull
, the Namespace from ClientOptions will be used.Other changes
SystemInfoInterceptor
constructor parameter:ConnectionInterface
instead ofServiceClient
.SystemInfoInterceptor
, new features related to caching Server Capabilities inside the Connection are considered.ServiceClient::setServerCapabilities()
method has been removed from theServiceClientInterface
. The implementing method just triggers a deprecation error.ServiceClient::getServerCapabilities()
method now loads the Server Capabilities from the Connection object instead of just returning the cached value.ServerCapabilities
DTO: added all the new fields; the flags are available as public properties.Workflow\Client\CountWorkflowExecutions
,Workflow\Client\Paginator
andWorkflow\Client\ServerCapabilities
into other namespaces.