@@ -11,7 +11,7 @@ use std::collections::HashSet;
11
11
use std:: marker:: PhantomData ;
12
12
use std:: sync:: { Arc , OnceLock } ;
13
13
use std:: time:: Duration ;
14
- use temporal_sdk_core:: api:: errors:: { PollActivityError , PollWfError } ;
14
+ use temporal_sdk_core:: api:: errors:: PollError ;
15
15
use temporal_sdk_core:: replay:: { HistoryForReplay , ReplayWorkerInput } ;
16
16
use temporal_sdk_core_api:: errors:: WorkflowErrorType ;
17
17
use temporal_sdk_core_api:: worker:: {
@@ -112,6 +112,7 @@ impl SlotReserveCtx {
112
112
SlotKindType :: Workflow => "workflow" . to_string ( ) ,
113
113
SlotKindType :: Activity => "activity" . to_string ( ) ,
114
114
SlotKindType :: LocalActivity => "local-activity" . to_string ( ) ,
115
+ SlotKindType :: Nexus => "nexus" . to_string ( ) ,
115
116
} ,
116
117
task_queue : ctx. task_queue ( ) . to_string ( ) ,
117
118
worker_identity : ctx. worker_identity ( ) . to_string ( ) ,
@@ -150,6 +151,13 @@ pub struct LocalActivitySlotInfo {
150
151
#[ pyo3( get) ]
151
152
pub activity_type : String ,
152
153
}
154
+ #[ pyclass]
155
+ pub struct NexusSlotInfo {
156
+ #[ pyo3( get) ]
157
+ pub service : String ,
158
+ #[ pyo3( get) ]
159
+ pub operation : String ,
160
+ }
153
161
154
162
#[ pyclass]
155
163
pub struct SlotReleaseCtx {
@@ -174,6 +182,11 @@ fn slot_info_to_py_obj(py: Python<'_>, info: SlotInfo) -> PyObject {
174
182
activity_type : a. activity_type . clone ( ) ,
175
183
}
176
184
. into_py ( py) ,
185
+ SlotInfo :: Nexus ( n) => NexusSlotInfo {
186
+ service : n. service . clone ( ) ,
187
+ operation : n. operation . clone ( ) ,
188
+ }
189
+ . into_py ( py) ,
177
190
}
178
191
}
179
192
@@ -441,7 +454,7 @@ impl WorkerRef {
441
454
self . runtime . future_into_py ( py, async move {
442
455
let bytes = match worker. poll_workflow_activation ( ) . await {
443
456
Ok ( act) => act. encode_to_vec ( ) ,
444
- Err ( PollWfError :: ShutDown ) => return Err ( PollShutdownError :: new_err ( ( ) ) ) ,
457
+ Err ( PollError :: ShutDown ) => return Err ( PollShutdownError :: new_err ( ( ) ) ) ,
445
458
Err ( err) => return Err ( PyRuntimeError :: new_err ( format ! ( "Poll failure: {}" , err) ) ) ,
446
459
} ;
447
460
let bytes: & [ u8 ] = & bytes;
@@ -454,7 +467,7 @@ impl WorkerRef {
454
467
self . runtime . future_into_py ( py, async move {
455
468
let bytes = match worker. poll_activity_task ( ) . await {
456
469
Ok ( task) => task. encode_to_vec ( ) ,
457
- Err ( PollActivityError :: ShutDown ) => return Err ( PollShutdownError :: new_err ( ( ) ) ) ,
470
+ Err ( PollError :: ShutDown ) => return Err ( PollShutdownError :: new_err ( ( ) ) ) ,
458
471
Err ( err) => return Err ( PyRuntimeError :: new_err ( format ! ( "Poll failure: {}" , err) ) ) ,
459
472
} ;
460
473
let bytes: & [ u8 ] = & bytes;
0 commit comments