Base class for worker plugins that can intercept and modify worker behavior.
Plugins allow customization of worker creation and execution processes through a chain of responsibility pattern. Each plugin can modify the worker configuration or intercept worker execution.
WARNING: This is an experimental feature and may change in the future.
Method | configure |
Hook called when creating a replayer to allow modification of configuration. |
Method | configure |
Hook called when creating a worker to allow modification of configuration. |
Method | name |
Get the qualified name of this plugin. Can be overridden if desired to provide a more appropriate name. |
Method | run |
Hook called when running a replayer to allow interception of execution. |
Async Method | run |
Hook called when running a worker to allow interception of execution. |
def configure_replayer(self, config:
ReplayerConfig
) -> ReplayerConfig
:
(source)
¶
temporalio.plugin.SimplePlugin
Hook called when creating a replayer to allow modification of configuration.
This should be used to configure anything in ReplayerConfig needed to make execution match the worker and client config. This could include interceptors, DataConverter, workflows, and more.
Parameters | |
config:ReplayerConfig | The replayer configuration dictionary to potentially modify. |
Returns | |
ReplayerConfig | The modified replayer configuration. |
temporalio.plugin.SimplePlugin
Hook called when creating a worker to allow modification of configuration.
This method is called during worker creation and allows plugins to modify the worker configuration before the worker is fully initialized. Plugins can modify task queue names, adjust concurrency settings, add interceptors, or change other worker settings.
Parameters | |
config:WorkerConfig | The worker configuration dictionary to potentially modify. |
Returns | |
WorkerConfig | The modified worker configuration. |
temporalio.plugin.SimplePlugin
Get the qualified name of this plugin. Can be overridden if desired to provide a more appropriate name.
Returns | |
str | The fully qualified name of the plugin class (module.classname). |
def run_replayer(self, replayer:
Replayer
, histories: AsyncIterator[ WorkflowHistory]
, next: Callable[ [ Replayer, AsyncIterator[ WorkflowHistory]], AbstractAsyncContextManager[ AsyncIterator[ WorkflowReplayResult]]]
) -> AbstractAsyncContextManager[ AsyncIterator[ WorkflowReplayResult]]
:
(source)
¶
temporalio.plugin.SimplePlugin
Hook called when running a replayer to allow interception of execution.
async def run_worker(self, worker:
Worker
, next: Callable[ [ Worker], Awaitable[ None]]
):
(source)
¶
temporalio.plugin.SimplePlugin
Hook called when running a worker to allow interception of execution.
This method is called when the worker is started and allows plugins to intercept or wrap the worker execution. Plugins can add monitoring, custom lifecycle management, or other execution-time behavior.
Parameters | |
worker:Worker | The worker instance to run. |
next:Callable[ | Callable to continue the worker execution. |