Skip to content

Commit

Permalink
Merge pull request #40 from sportsball-ai/fix-custom-waiter
Browse files Browse the repository at this point in the history
make with_custom_wait_for_work actually return self
  • Loading branch information
cksac authored Nov 13, 2024
2 parents 1a10661 + df65cda commit 998d77f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/cached.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ where
/// Replaces the yielding for work behavior with an arbitrary future. Rather than yielding
/// the runtime repeatedly this will generate and `.await` a future of your choice.
/// ***This is incompatible with*** [`Self::with_yield_count()`].
pub fn with_custom_wait_for_work(mut self, wait_for_work_fn: impl WaitForWorkFn) {
pub fn with_custom_wait_for_work(mut self, wait_for_work_fn: impl WaitForWorkFn) -> Self {
self.wait_for_work_fn = Arc::new(wait_for_work_fn);
self
}

pub fn max_batch_size(&self) -> usize {
Expand Down
3 changes: 2 additions & 1 deletion src/non_cached.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ where
/// Replaces the yielding for work behavior with an arbitrary future. Rather than yielding
/// the runtime repeatedly this will generate and `.await` a future of your choice.
/// ***This is incompatible with*** [`Self::with_yield_count()`].
pub fn with_custom_wait_for_work(mut self, wait_for_work_fn: impl WaitForWorkFn) {
pub fn with_custom_wait_for_work(mut self, wait_for_work_fn: impl WaitForWorkFn) -> Self {
self.wait_for_work_fn = Arc::new(wait_for_work_fn);
self
}

pub fn max_batch_size(&self) -> usize {
Expand Down

0 comments on commit 998d77f

Please sign in to comment.