BaseClient
in package
implements
ServiceClientInterface
Table of Contents
Interfaces
Constants
- RETRYABLE_ERRORS = [\Temporal\Client\GRPC\StatusCode::RESOURCE_EXHAUSTED, \Temporal\Client\GRPC\StatusCode::UNAVAILABLE, \Temporal\Client\GRPC\StatusCode::UNKNOWN]
Properties
- $apiKey : Stringable|string
- $connection : Connection
- $context : ContextInterface
- $invokePipeline : null|callable(string $method, object $arg, ContextInterface $ctx): object
Methods
- __construct() : mixed
- close() : void
- Close the communication channel associated with this stub.
- create() : static
- createSSL() : static
- getConnection() : ConnectionInterface
- Note: Experimental
- getContext() : ContextInterface
- getServerCapabilities() : ServerCapabilities|null
- setServerCapabilities() : void
- withAuthKey() : static
- Set the authentication token for the service client.
- withContext() : static
- withInterceptorPipeline() : static
- invoke() : mixed
- call() : object
- Call a gRPC method.
- usleep() : void
Constants
RETRYABLE_ERRORS
public
mixed
RETRYABLE_ERRORS
= [\Temporal\Client\GRPC\StatusCode::RESOURCE_EXHAUSTED, \Temporal\Client\GRPC\StatusCode::UNAVAILABLE, \Temporal\Client\GRPC\StatusCode::UNKNOWN]
Properties
$apiKey
private
Stringable|string
$apiKey
= ''
$connection
private
Connection
$connection
$context
private
ContextInterface
$context
$invokePipeline
private
null|callable(string $method, object $arg, ContextInterface $ctx): object
$invokePipeline
= null
Methods
__construct()
public
final __construct(WorkflowServiceClient|callable(): WorkflowServiceClient $workflowService) : mixed
Parameters
- $workflowService : WorkflowServiceClient|callable(): WorkflowServiceClient
-
Service Client or its factory
Tags
close()
Close the communication channel associated with this stub.
public
close() : void
create()
public
static create(non-empty-string $address) : static
Parameters
- $address : non-empty-string
-
Temporal service address in format
host:port
Tags
Return values
staticcreateSSL()
public
static createSSL(non-empty-string $address[, non-empty-string|null $crt = null ][, non-empty-string|null $clientKey = null ][, non-empty-string|null $clientPem = null ][, non-empty-string|null $overrideServerName = null ]) : static
Parameters
- $address : non-empty-string
-
Temporal service address in format
host:port
- $crt : non-empty-string|null = null
-
Root certificates string or file in PEM format. If null provided, default gRPC root certificates are used.
- $clientKey : non-empty-string|null = null
-
Client private key string or file in PEM format.
- $clientPem : non-empty-string|null = null
-
Client certificate chain string or file in PEM format.
- $overrideServerName : non-empty-string|null = null
Tags
Return values
staticgetConnection()
Note: Experimental
public
getConnection() : ConnectionInterface
Return values
ConnectionInterfacegetContext()
public
getContext() : ContextInterface
Return values
ContextInterfacegetServerCapabilities()
public
getServerCapabilities() : ServerCapabilities|null
Return values
ServerCapabilities|nullsetServerCapabilities()
public
setServerCapabilities(ServerCapabilities $capabilities) : void
Parameters
- $capabilities : ServerCapabilities
Tags
withAuthKey()
Set the authentication token for the service client.
public
withAuthKey(Stringable|string $key) : static
This is the equivalent of providing an "Authorization" header with "Bearer " + the given key. This will overwrite any "Authorization" header that may be on the context before each request to the Temporal service. You may pass your own Stringable implementation to be able to change the key dynamically.
Parameters
- $key : Stringable|string
Return values
staticwithContext()
public
withContext(ContextInterface $context) : static
Parameters
- $context : ContextInterface
Return values
staticwithInterceptorPipeline()
public
final withInterceptorPipeline(null|Pipeline<GrpcClientInterceptor, object> $pipeline) : static
Parameters
- $pipeline : null|Pipeline<GrpcClientInterceptor, object>
Return values
staticinvoke()
protected
invoke(non-empty-string $method, object $arg[, ContextInterface|null $ctx = null ]) : mixed
Parameters
- $method : non-empty-string
-
RPC method name
- $arg : object
- $ctx : ContextInterface|null = null
Tags
call()
Call a gRPC method.
private
call(non-empty-string $method, object $arg, ContextInterface $ctx) : object
Used in withInterceptorPipeline()
Parameters
- $method : non-empty-string
- $arg : object
- $ctx : ContextInterface
Tags
Return values
objectusleep()
private
usleep(int<0, max> $param) : void
Parameters
- $param : int<0, max>
-
Delay in microseconds