File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ import nexusrpc
2
+
3
+ import temporalio .nexus
4
+ from temporalio import workflow
5
+
6
+
7
+ def _ ():
8
+ @nexusrpc .handler .service_handler
9
+ class MyService :
10
+ @nexusrpc .handler .sync_operation
11
+ async def my_sync_operation (
12
+ self , ctx : nexusrpc .handler .StartOperationContext , input : int
13
+ ) -> str :
14
+ raise NotImplementedError
15
+
16
+ @temporalio .nexus .workflow_run_operation
17
+ async def my_workflow_run_operation (
18
+ self , ctx : temporalio .nexus .WorkflowRunOperationContext , input : int
19
+ ) -> temporalio .nexus .WorkflowHandle [str ]:
20
+ raise NotImplementedError
21
+
22
+ @workflow .defn (sandboxed = False )
23
+ class MyWorkflow :
24
+ @workflow .run
25
+ async def invoke_nexus_op_and_assert_error (self ) -> None :
26
+ self .nexus_client = workflow .create_nexus_client (
27
+ service = MyService ,
28
+ endpoint = "fake-endpoint" ,
29
+ )
30
+ await self .nexus_client .execute_operation (MyService .my_sync_operation , 1 )
31
+ await self .nexus_client .execute_operation (
32
+ MyService .my_workflow_run_operation , 1
33
+ )
You can’t perform that action at this time.
0 commit comments