Skip to main content

WorkerTuner

Trait WorkerTuner 

Source
pub trait WorkerTuner {
    // Required methods
    fn workflow_task_slot_supplier(
        &self,
    ) -> Arc<dyn SlotSupplier<SlotKind = WorkflowSlotKind> + Sync + Send> ;
    fn activity_task_slot_supplier(
        &self,
    ) -> Arc<dyn SlotSupplier<SlotKind = ActivitySlotKind> + Sync + Send> ;
    fn local_activity_slot_supplier(
        &self,
    ) -> Arc<dyn SlotSupplier<SlotKind = LocalActivitySlotKind> + Sync + Send> ;
    fn nexus_task_slot_supplier(
        &self,
    ) -> Arc<dyn SlotSupplier<SlotKind = NexusSlotKind> + Sync + Send> ;
}
Expand description

This trait allows users to customize the performance characteristics of workers dynamically. For more, see the docstrings of the traits in the return types of its functions.

Required Methods§

Source

fn workflow_task_slot_supplier( &self, ) -> Arc<dyn SlotSupplier<SlotKind = WorkflowSlotKind> + Sync + Send>

Return a SlotSupplier for workflow tasks. Note that workflow task slot suppliers must be willing to hand out a minimum of one non-sticky slot and one sticky slot if workflow caching is enabled, otherwise the worker may fail to process new tasks.

Source

fn activity_task_slot_supplier( &self, ) -> Arc<dyn SlotSupplier<SlotKind = ActivitySlotKind> + Sync + Send>

Return a SlotSupplier for activity tasks

Source

fn local_activity_slot_supplier( &self, ) -> Arc<dyn SlotSupplier<SlotKind = LocalActivitySlotKind> + Sync + Send>

Return a SlotSupplier for local activities

Source

fn nexus_task_slot_supplier( &self, ) -> Arc<dyn SlotSupplier<SlotKind = NexusSlotKind> + Sync + Send>

Return a SlotSupplier for nexus tasks

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl WorkerTuner for TunerHolder

Source§

impl<MI> WorkerTuner for ResourceBasedTuner<MI>
where MI: SystemResourceInfo + Sync + Send + 'static,