class Plugin(abc.ABC): (source)
Known subclasses: temporalio.worker._worker._RootPlugin
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.
Method | configure |
Hook called when creating a worker to allow modification of configuration. |
Method | init |
Initialize this plugin in the plugin chain. |
Method | name |
Get the qualified name of this plugin. Can be overridden if desired to provide a more appropriate name. |
Async Method | run |
Hook called when running a worker to allow interception of execution. |
Instance Variable | next |
Undocumented |
temporalio.worker._worker._RootPlugin
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. |
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 worker creation to build the plugin chain.
Parameters | |
next:Plugin | The next plugin in the chain to delegate to. |
Returns | |
Plugin | This plugin instance for method chaining. |
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). |
temporalio.worker._worker._RootPlugin
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. |