Skip to content

Commit be7d269

Browse files
committed
Python API updates
1 parent e479c8a commit be7d269

File tree

7 files changed

+335
-74
lines changed

7 files changed

+335
-74
lines changed

temporalio/bridge/Cargo.lock

Lines changed: 51 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporalio/bridge/worker.py

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class WorkerConfig:
4444

4545
namespace: str
4646
task_queue: str
47-
build_id: str
47+
versioning_strategy: WorkerVersioningStrategy
4848
identity_override: Optional[str]
4949
max_cached_workflows: int
5050
tuner: TunerHolder
@@ -58,11 +58,56 @@ class WorkerConfig:
5858
max_activities_per_second: Optional[float]
5959
max_task_queue_activities_per_second: Optional[float]
6060
graceful_shutdown_period_millis: int
61-
use_worker_versioning: bool
6261
nondeterminism_as_workflow_fail: bool
6362
nondeterminism_as_workflow_fail_for_types: Set[str]
6463

6564

65+
@dataclass
66+
class WorkerDeploymentVersion:
67+
"""Python representation of the Rust struct for configuring a worker deployment version."""
68+
69+
deployment_name: str
70+
build_id: str
71+
72+
73+
@dataclass
74+
class WorkerDeploymentOptions:
75+
"""Python representation of the Rust struct for configuring a worker deployment options."""
76+
77+
version: WorkerDeploymentVersion
78+
use_worker_versioning: bool
79+
default_versioning_behavior: int
80+
"""An enums.v1.VersioningBehavior as an int"""
81+
82+
83+
@dataclass
84+
class WorkerVersioningStrategyNone:
85+
"""Python representation of the Rust struct for configuring a worker versioning strategy None."""
86+
87+
build_id: str
88+
89+
90+
@dataclass
91+
class WorkerVersioningStrategyDeploymentBased:
92+
"""Python representation of the Rust struct for configuring a worker versioning strategy deployment-based."""
93+
94+
options: WorkerDeploymentOptions
95+
96+
97+
@dataclass
98+
class WorkerVersioningStrategyLegacyBuildIdBased:
99+
"""Python representation of the Rust struct for configuring a worker versioning strategy legacy Build ID-based."""
100+
101+
build_id: str
102+
103+
104+
WorkerVersioningStrategy: TypeAlias = Union[
105+
WorkerVersioningStrategyNone,
106+
WorkerVersioningStrategyDeploymentBased,
107+
WorkerVersioningStrategyLegacyBuildIdBased,
108+
]
109+
110+
66111
@dataclass
67112
class ResourceBasedTunerConfig:
68113
"""Python representation of the Rust struct for configuring a resource-based tuner."""

0 commit comments

Comments
 (0)