@@ -11,7 +11,7 @@ use std::collections::HashSet;
1111use std:: marker:: PhantomData ;
1212use std:: sync:: { Arc , OnceLock } ;
1313use std:: time:: Duration ;
14- use temporal_sdk_core:: api:: errors:: { PollActivityError , PollWfError } ;
14+ use temporal_sdk_core:: api:: errors:: PollError ;
1515use temporal_sdk_core:: replay:: { HistoryForReplay , ReplayWorkerInput } ;
1616use temporal_sdk_core_api:: errors:: WorkflowErrorType ;
1717use temporal_sdk_core_api:: worker:: {
@@ -112,6 +112,7 @@ impl SlotReserveCtx {
112112 SlotKindType :: Workflow => "workflow" . to_string ( ) ,
113113 SlotKindType :: Activity => "activity" . to_string ( ) ,
114114 SlotKindType :: LocalActivity => "local-activity" . to_string ( ) ,
115+ SlotKindType :: Nexus => "nexus" . to_string ( ) ,
115116 } ,
116117 task_queue : ctx. task_queue ( ) . to_string ( ) ,
117118 worker_identity : ctx. worker_identity ( ) . to_string ( ) ,
@@ -150,6 +151,13 @@ pub struct LocalActivitySlotInfo {
150151 #[ pyo3( get) ]
151152 pub activity_type : String ,
152153}
154+ #[ pyclass]
155+ pub struct NexusSlotInfo {
156+ #[ pyo3( get) ]
157+ pub service : String ,
158+ #[ pyo3( get) ]
159+ pub operation : String ,
160+ }
153161
154162#[ pyclass]
155163pub struct SlotReleaseCtx {
@@ -174,6 +182,11 @@ fn slot_info_to_py_obj(py: Python<'_>, info: SlotInfo) -> PyObject {
174182 activity_type : a. activity_type . clone ( ) ,
175183 }
176184 . into_py ( py) ,
185+ SlotInfo :: Nexus ( n) => NexusSlotInfo {
186+ service : n. service . clone ( ) ,
187+ operation : n. operation . clone ( ) ,
188+ }
189+ . into_py ( py) ,
177190 }
178191}
179192
@@ -441,7 +454,7 @@ impl WorkerRef {
441454 self . runtime . future_into_py ( py, async move {
442455 let bytes = match worker. poll_workflow_activation ( ) . await {
443456 Ok ( act) => act. encode_to_vec ( ) ,
444- Err ( PollWfError :: ShutDown ) => return Err ( PollShutdownError :: new_err ( ( ) ) ) ,
457+ Err ( PollError :: ShutDown ) => return Err ( PollShutdownError :: new_err ( ( ) ) ) ,
445458 Err ( err) => return Err ( PyRuntimeError :: new_err ( format ! ( "Poll failure: {}" , err) ) ) ,
446459 } ;
447460 let bytes: & [ u8 ] = & bytes;
@@ -454,7 +467,7 @@ impl WorkerRef {
454467 self . runtime . future_into_py ( py, async move {
455468 let bytes = match worker. poll_activity_task ( ) . await {
456469 Ok ( task) => task. encode_to_vec ( ) ,
457- Err ( PollActivityError :: ShutDown ) => return Err ( PollShutdownError :: new_err ( ( ) ) ) ,
470+ Err ( PollError :: ShutDown ) => return Err ( PollShutdownError :: new_err ( ( ) ) ) ,
458471 Err ( err) => return Err ( PyRuntimeError :: new_err ( format ! ( "Poll failure: {}" , err) ) ) ,
459472 } ;
460473 let bytes: & [ u8 ] = & bytes;
0 commit comments