Skip to content

Commit fa8d470

Browse files
committed
Review comments
1 parent d514f44 commit fa8d470

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

core-api/src/worker.rs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,19 @@ impl WorkerConfigBuilder {
225225
}
226226
}
227227

228+
if matches!(self.max_outstanding_workflow_tasks.as_ref(), Some(Some(v)) if *v == 0) {
229+
return Err("`max_outstanding_workflow_tasks` must be > 0".to_owned());
230+
}
231+
if matches!(self.max_outstanding_activities.as_ref(), Some(Some(v)) if *v == 0) {
232+
return Err("`max_outstanding_activities` must be > 0".to_owned());
233+
}
234+
if matches!(self.max_outstanding_local_activities.as_ref(), Some(Some(v)) if *v == 0) {
235+
return Err("`max_outstanding_local_activities` must be > 0".to_owned());
236+
}
237+
if matches!(self.max_outstanding_nexus_tasks.as_ref(), Some(Some(v)) if *v == 0) {
238+
return Err("`max_outstanding_nexus_tasks` must be > 0".to_owned());
239+
}
240+
228241
if let Some(cache) = self.max_cached_workflows.as_ref() {
229242
if *cache > 0 {
230243
if let Some(Some(max_wft)) = self.max_outstanding_workflow_tasks.as_ref() {
@@ -288,8 +301,8 @@ impl WorkerConfigBuilder {
288301
/// For more, see the docstrings of the traits in the return types of its functions.
289302
pub trait WorkerTuner {
290303
/// Return a [SlotSupplier] for workflow tasks. Note that workflow task slot suppliers must be
291-
/// willing to hand out a minimum of two slots if workflow caching is enabled, otherwise the
292-
/// worker may fail to process new tasks.
304+
/// willing to hand out a minimum of one non-sticky slot and one sticky slot if workflow caching
305+
/// is enabled, otherwise the worker may fail to process new tasks.
293306
fn workflow_task_slot_supplier(
294307
&self,
295308
) -> Arc<dyn SlotSupplier<SlotKind = WorkflowSlotKind> + Send + Sync>;
@@ -414,11 +427,6 @@ impl SlotSupplierPermit {
414427
pub fn user_data_mut<T: Any + Send + Sync>(&mut self) -> Option<&mut T> {
415428
self.user_data.as_mut().and_then(|b| b.downcast_mut())
416429
}
417-
418-
/// Deconstruct this permit and return the inner data
419-
pub fn into_user_data(self) -> Option<Box<dyn Any + Send + Sync>> {
420-
self.user_data
421-
}
422430
}
423431

424432
#[derive(Debug, Copy, Clone, derive_more::Display, Eq, PartialEq)]

0 commit comments

Comments
 (0)