Skip to content

Commit 963de97

Browse files
committed
Support using service impl instead of interface
1 parent 009edf6 commit 963de97

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

temporalio/workflow.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import asyncio
66
import contextvars
7-
import dataclasses
87
import inspect
98
import logging
109
import threading
@@ -43,6 +42,7 @@
4342
)
4443

4544
import nexusrpc
45+
import nexusrpc.handler
4646
from typing_extensions import (
4747
Concatenate,
4848
Literal,
@@ -5158,7 +5158,7 @@ def __init__(
51585158
# TODO(dan): overloads: no-input, operation name, ret type
51595159
async def start_operation(
51605160
self,
5161-
operation: Union[nexusrpc.Operation[I, O], str],
5161+
operation: Union[nexusrpc.interface.Operation[I, O], str],
51625162
input: I,
51635163
*,
51645164
schedule_to_close_timeout: Optional[timedelta] = None,
@@ -5178,7 +5178,11 @@ async def start_operation(
51785178
# TODO(dan): overloads: no-input, operation name, ret type
51795179
async def execute_operation(
51805180
self,
5181-
operation: nexusrpc.Operation[I, O],
5181+
operation: Union[
5182+
nexusrpc.interface.Operation[I, O],
5183+
Callable[..., nexusrpc.handler.Operation[I, O]],
5184+
str,
5185+
],
51825186
input: I,
51835187
*,
51845188
schedule_to_close_timeout: Optional[timedelta] = None,

0 commit comments

Comments
 (0)