class documentation
class SimplePlugin(temporalio.client.Plugin, temporalio.worker.Plugin): (source)
Known subclasses: temporalio.contrib.openai_agents.OpenAIAgentsPlugin
Constructor: SimplePlugin(name, data_converter, client_interceptors, activities, ...)
A simple plugin definition which has a limited set of configurations but makes it easier to produce a plugin which needs to configure them.
Method | __init__ |
component for which they are applicable. All arguments are optional, and all but run_context can also be callables for more complex modification. See the type PluginParameter above. For details on each argument, see below. |
Method | configure |
See base class. |
Method | configure |
See base class. |
Method | configure |
See base class. |
Async Method | connect |
See base class. |
Method | name |
See base class. |
Async Method | run |
See base class. |
Async Method | run |
See base class. |
Instance Variable | activities |
Undocumented |
Instance Variable | client |
Undocumented |
Instance Variable | data |
Undocumented |
Instance Variable | nexus |
Undocumented |
Instance Variable | run |
Undocumented |
Instance Variable | worker |
Undocumented |
Instance Variable | workflow |
Undocumented |
Instance Variable | workflow |
Undocumented |
Instance Variable | workflows |
Undocumented |
Instance Variable | _name |
Undocumented |
def __init__(self, name:
str
, *, data_converter: PluginParameter[ temporalio.converter.DataConverter]
= None, client_interceptors: PluginParameter[ Sequence[ temporalio.client.Interceptor]]
= None, activities: PluginParameter[ Sequence[ Callable]]
= None, nexus_service_handlers: PluginParameter[ Sequence[ Any]]
= None, workflows: PluginParameter[ Sequence[ type]]
= None, workflow_runner: PluginParameter[ WorkflowRunner]
= None, worker_interceptors: PluginParameter[ Sequence[ temporalio.worker.Interceptor]]
= None, workflow_failure_exception_types: PluginParameter[ Sequence[ type[ BaseException]]]
= None, run_context: Callable[ [], AbstractAsyncContextManager[ None]] | None
= None):
(source)
¶
overridden in
temporalio.contrib.openai_agents.OpenAIAgentsPlugin
- Create a simple plugin with configurable parameters. Each of the parameters will be applied to any
- component for which they are applicable. All arguments are optional, and all but run_context can also be callables for more complex modification. See the type PluginParameter above. For details on each argument, see below.
Parameters | |
name:str | The name of the plugin. |
dataPluginParameter[ | Data converter for serialization, or callable to customize existing one. Applied to the Client and Replayer. |
clientPluginParameter[ | Client interceptors to append, or callable to customize existing ones. Applied to the Client. Note, if the provided interceptor is also a worker.Interceptor, it will be added to any worker which uses that client. |
activities:PluginParameter[ | Activity functions to append, or callable to customize existing ones. Applied to the Worker. |
nexusPluginParameter[ | Nexus service handlers to append, or callable to customize existing ones. Applied to the Worker. |
workflows:PluginParameter[ | Workflow classes to append, or callable to customize existing ones. Applied to the Worker and Replayer. |
workflowPluginParameter[ | Workflow runner, or callable to customize existing one. Applied to the Worker and Replayer. |
workerPluginParameter[ | Worker interceptors to append, or callable to customize existing ones. Applied to the Worker and Replayer. |
workflowPluginParameter[ | Exception types for workflow failures to append, or callable to customize existing ones. Applied to the Worker and Replayer. |
runCallable[ | A place to run custom code to wrap around the Worker (or Replayer) execution. Specifically, it's an async context manager producer. Applied to the Worker and Replayer. |
Returns | |
A configured Plugin instance. |
async def connect_service_client(self, config:
ConnectConfig
, next: Callable[ [ ConnectConfig], Awaitable[ ServiceClient]]
) -> temporalio.service.ServiceClient
:
(source)
¶
See base class.
@asynccontextmanager
async def run_replayer(self, replayer:
async def run_replayer(self, replayer:
Replayer
, histories: AsyncIterator[ WorkflowHistory]
, next: Callable[ [ Replayer, AsyncIterator[ WorkflowHistory]], AbstractAsyncContextManager[ AsyncIterator[ WorkflowReplayResult]]]
) -> AsyncIterator[ AsyncIterator[ WorkflowReplayResult]]
:
(source)
¶
overrides
temporalio.worker.Plugin.run_replayer
See base class.