@@ -166,6 +166,9 @@ pub fn worker_complete_workflow_activation(
166166 ) ,
167167 }
168168 }
169+ CompleteWfError :: WorkflowNotEnabled => {
170+ BridgeError :: UnexpectedError ( format ! ( "{err}" ) )
171+ }
169172 } )
170173 } )
171174}
@@ -225,6 +228,9 @@ pub fn worker_complete_activity_task(
225228 field : None ,
226229 message : format ! ( "Malformed Activity Completion: {reason:?}" ) ,
227230 } ,
231+ CompleteActivityError :: ActivityNotEnabled => {
232+ BridgeError :: UnexpectedError ( format ! ( "{err}" ) )
233+ }
228234 } )
229235 } )
230236}
@@ -466,6 +472,7 @@ mod config {
466472 use std:: { sync:: Arc , time:: Duration } ;
467473
468474 use temporalio_common:: protos:: temporal:: api:: enums:: v1:: VersioningBehavior as CoreVersioningBehavior ;
475+ use temporalio_common:: protos:: temporal:: api:: worker:: v1:: PluginInfo ;
469476 use temporalio_common:: worker:: {
470477 ActivitySlotKind , LocalActivitySlotKind , NexusSlotKind ,
471478 PollerBehavior as CorePollerBehavior , SlotKind , WorkerConfig , WorkerConfigBuilder ,
@@ -499,14 +506,15 @@ mod config {
499506 workflow_task_poller_behavior : PollerBehavior ,
500507 activity_task_poller_behavior : PollerBehavior ,
501508 nexus_task_poller_behavior : PollerBehavior ,
502- enable_non_local_activities : bool ,
509+ task_types : WorkerTaskTypes ,
503510 sticky_queue_schedule_to_start_timeout : Duration ,
504511 max_cached_workflows : usize ,
505512 max_heartbeat_throttle_interval : Duration ,
506513 default_heartbeat_throttle_interval : Duration ,
507514 max_activities_per_second : Option < f64 > ,
508515 max_task_queue_activities_per_second : Option < f64 > ,
509516 shutdown_grace_time : Option < Duration > ,
517+ plugins : Vec < String > ,
510518 }
511519
512520 #[ derive( TryFromJs ) ]
@@ -540,6 +548,25 @@ mod config {
540548 AutoUpgrade ,
541549 }
542550
551+ #[ derive( TryFromJs ) ]
552+ pub struct WorkerTaskTypes {
553+ enable_workflows : bool ,
554+ enable_local_activities : bool ,
555+ enable_remote_activities : bool ,
556+ enable_nexus : bool ,
557+ }
558+
559+ impl From < & WorkerTaskTypes > for temporalio_common:: worker:: WorkerTaskTypes {
560+ fn from ( t : & WorkerTaskTypes ) -> Self {
561+ Self {
562+ enable_workflows : t. enable_workflows ,
563+ enable_local_activities : t. enable_local_activities ,
564+ enable_remote_activities : t. enable_remote_activities ,
565+ enable_nexus : t. enable_nexus ,
566+ }
567+ }
568+ }
569+
543570 impl BridgeWorkerOptions {
544571 pub ( crate ) fn into_core_config ( self ) -> Result < WorkerConfig , WorkerConfigBuilderError > {
545572 // Set all other options
@@ -566,14 +593,23 @@ mod config {
566593 . workflow_task_poller_behavior ( self . workflow_task_poller_behavior )
567594 . activity_task_poller_behavior ( self . activity_task_poller_behavior )
568595 . nexus_task_poller_behavior ( self . nexus_task_poller_behavior )
569- . no_remote_activities ( ! self . enable_non_local_activities )
596+ . task_types ( & self . task_types )
570597 . sticky_queue_schedule_to_start_timeout ( self . sticky_queue_schedule_to_start_timeout )
571598 . max_cached_workflows ( self . max_cached_workflows )
572599 . max_heartbeat_throttle_interval ( self . max_heartbeat_throttle_interval )
573600 . default_heartbeat_throttle_interval ( self . default_heartbeat_throttle_interval )
574601 . max_task_queue_activities_per_second ( self . max_task_queue_activities_per_second )
575602 . max_worker_activities_per_second ( self . max_activities_per_second )
576603 . graceful_shutdown_period ( self . shutdown_grace_time )
604+ . plugins (
605+ self . plugins
606+ . into_iter ( )
607+ . map ( |name| PluginInfo {
608+ name,
609+ version : String :: new ( ) ,
610+ } )
611+ . collect :: < Vec < _ > > ( ) ,
612+ )
577613 . build ( )
578614 }
579615 }
0 commit comments