Skip to content

Commit 256bc4a

Browse files
authored
Worker package refactor (#15)
1 parent fc528ee commit 256bc4a

File tree

9 files changed

+569
-441
lines changed

9 files changed

+569
-441
lines changed

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666

6767
autodoc_typehints_description_target = "documented"
6868

69+
autodoc_typehints_format = "short"
70+
6971
autodoc_preserve_defaults = True
7072

7173
autodoc_member_order = "bysource"

poetry.lock

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ mypy-protobuf = "^3.2.0"
4242
pydocstyle = "^6.1.1"
4343
pytest = "^6.2.5"
4444
pytest-asyncio = "^0.18.0"
45+
pytest-timeout = "^2.1.0"
4546
setuptools = "^60.9.3"
4647
setuptools-rust = "^1.1.2"
4748
Sphinx = "^4.4.0"
@@ -84,6 +85,8 @@ asyncio_mode = "auto"
8485
log_cli = true
8586
log_cli_level = "INFO"
8687
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
88+
timeout = 60
89+
timeout_func_only = true
8790

8891
[tool.isort]
8992
profile = "black"

temporalio/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
overload,
2323
)
2424

25-
import typing_extensions
25+
from typing_extensions import TypedDict
2626

2727
import temporalio.api.common.v1
2828
import temporalio.api.enums.v1
@@ -359,7 +359,7 @@ def get_activity_completion_handle(
359359
raise ValueError("Task token or workflow/run/activity ID must be present")
360360

361361

362-
class ClientConfig(typing_extensions.TypedDict, total=False):
362+
class ClientConfig(TypedDict, total=False):
363363
"""TypedDict of config originally passed to :py:meth:`Client`."""
364364

365365
service: temporalio.workflow_service.WorkflowService

temporalio/worker/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""Worker for processing Temporal workflows and/or activities."""
2+
3+
from .activity import SharedHeartbeatSender, SharedStateManager
4+
from .interceptor import (
5+
ActivityInboundInterceptor,
6+
ActivityOutboundInterceptor,
7+
ExecuteActivityInput,
8+
Interceptor,
9+
)
10+
from .worker import Worker, WorkerConfig
11+
12+
__all__ = [
13+
"Worker",
14+
"WorkerConfig",
15+
"ExecuteActivityInput",
16+
"Interceptor",
17+
"ActivityInboundInterceptor",
18+
"ActivityOutboundInterceptor",
19+
"SharedStateManager",
20+
"SharedHeartbeatSender",
21+
]

0 commit comments

Comments
 (0)