26
26
27
27
from temporalio import client
28
28
from temporalio .nexus ._operation_context import (
29
- _temporal_start_operation_context ,
29
+ _temporal_cancel_operation_context ,
30
30
)
31
31
from temporalio .nexus ._token import WorkflowHandle
32
32
@@ -105,27 +105,27 @@ async def fetch_result(
105
105
)
106
106
# An implementation is provided for future reference:
107
107
# TODO: honor `wait` param and Request-Timeout header
108
- try :
109
- nexus_handle = WorkflowHandle [OutputT ].from_token (token )
110
- except Exception as err :
111
- raise HandlerError (
112
- "Failed to decode operation token as workflow operation token. "
113
- "Fetching result for non-workflow operations is not supported." ,
114
- type = HandlerErrorType .NOT_FOUND ,
115
- cause = err ,
116
- )
117
- ctx = _temporal_start_operation_context .get ()
118
- try :
119
- client_handle = nexus_handle .to_workflow_handle (
120
- ctx .client , result_type = self ._output_type
121
- )
122
- except Exception as err :
123
- raise HandlerError (
124
- "Failed to construct workflow handle from workflow operation token" ,
125
- type = HandlerErrorType .NOT_FOUND ,
126
- cause = err ,
127
- )
128
- return await client_handle .result ()
108
+ # try:
109
+ # nexus_handle = WorkflowHandle[OutputT].from_token(token)
110
+ # except Exception as err:
111
+ # raise HandlerError(
112
+ # "Failed to decode operation token as workflow operation token. "
113
+ # "Fetching result for non-workflow operations is not supported.",
114
+ # type=HandlerErrorType.NOT_FOUND,
115
+ # cause=err,
116
+ # )
117
+ # ctx = _temporal_fetch_operation_context .get()
118
+ # try:
119
+ # client_handle = nexus_handle.to_workflow_handle(
120
+ # ctx.client, result_type=self._output_type
121
+ # )
122
+ # except Exception as err:
123
+ # raise HandlerError(
124
+ # "Failed to construct workflow handle from workflow operation token",
125
+ # type=HandlerErrorType.NOT_FOUND,
126
+ # cause=err,
127
+ # )
128
+ # return await client_handle.result()
129
129
130
130
131
131
async def cancel_operation (
@@ -148,7 +148,7 @@ async def cancel_operation(
148
148
cause = err ,
149
149
)
150
150
151
- ctx = _temporal_start_operation_context .get ()
151
+ ctx = _temporal_cancel_operation_context .get ()
152
152
try :
153
153
client_workflow_handle = nexus_workflow_handle ._to_client_workflow_handle (
154
154
ctx .client
0 commit comments