class documentation

Base class for client plugins that can intercept and modify client behavior.

Plugins allow customization of client creation and service connection processes through a chain of responsibility pattern. Each plugin can modify the client configuration or intercept service client connections.

If the plugin is also a temporalio.worker.Plugin, it will additionally be propagated as a worker plugin. You should likley not also provide it to the worker as that will result in the plugin being applied twice.

Method configure_client Hook called when creating a client to allow modification of configuration.
Async Method connect_service_client Hook called when connecting to the Temporal service.
Method init_client_plugin Initialize this plugin in the plugin chain.
Method name Get the name of this plugin. Can be overridden if desired to provide a more appropriate name.
Instance Variable next_client_plugin Undocumented
def configure_client(self, config: ClientConfig) -> ClientConfig: (source)

Hook called when creating a client to allow modification of configuration.

This method is called during client creation and allows plugins to modify the client configuration before the client is fully initialized. Plugins can add interceptors, modify connection parameters, or change other settings.

Parameters
config:ClientConfigThe client configuration dictionary to potentially modify.
Returns
ClientConfigThe modified client configuration.
async def connect_service_client(self, config: temporalio.service.ConnectConfig) -> temporalio.service.ServiceClient: (source)

Hook called when connecting to the Temporal service.

This method is called during service client connection and allows plugins to intercept or modify the connection process. Plugins can modify connection parameters, add authentication, or provide custom connection logic.

Parameters
config:temporalio.service.ConnectConfigThe service connection configuration.
Returns
temporalio.service.ServiceClientThe connected service client.
def init_client_plugin(self, next: Plugin) -> Plugin: (source)

Initialize this plugin in the plugin chain.

This method sets up the chain of responsibility pattern by storing a reference to the next plugin in the chain. It is called during client creation to build the plugin chain. Note, this may be called twice in the case of connect.

Parameters
next:PluginThe next plugin in the chain to delegate to.
Returns
PluginThis plugin instance for method chaining.
def name(self) -> str: (source)

Get the name of this plugin. Can be overridden if desired to provide a more appropriate name.

Returns
strThe fully qualified name of the plugin class (module.classname).
next_client_plugin = (source)

Undocumented