GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sdk-python/temporalio/client/_plugin.py at main · temporalio/sdk-python

Expand file tree

/

_plugin.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
86 lines (65 loc) · 2.78 KB
/

_plugin.py

Copy path

File metadata and controls

86 lines (65 loc) · 2.78 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
"""Client support for accessing Temporal."""
from __future__ import annotations
import abc
from abc import abstractmethod
from collections.abc import (
Awaitable,
Callable,
)
from typing import (
TYPE_CHECKING,
)
from temporalio.service import (
ConnectConfig,
ServiceClient,
)
if TYPE_CHECKING:
from ._client import ClientConfig
class Plugin(abc.ABC):
"""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.
"""
def name(self) -> str:
"""Get the name of this plugin. Can be overridden if desired to provide a more appropriate name.
Returns:
The fully qualified name of the plugin class (module.classname).
"""
return type(self).__module__ + "." + type(self).__qualname__
def version(self) -> str:
"""Get the version of this plugin. Can be overridden to provide a version.
Clients don't report plugin versions yet. A plugin that is also a
temporalio.worker.Plugin reports its version in worker heartbeats.
Returns:
The version of the plugin. Empty by default.
"""
return ""
@abstractmethod
def configure_client(self, config: ClientConfig) -> ClientConfig:
"""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.
Args:
config: The client configuration dictionary to potentially modify.
Returns:
The modified client configuration.
"""
@abstractmethod
async def connect_service_client(
self,
config: ConnectConfig,
next: Callable[[ConnectConfig], Awaitable[ServiceClient]],
) -> ServiceClient:
"""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.
Args:
config: The service connection configuration.
Returns:
The connected service client.
"""
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.