Skip to content

Commit

Permalink
feat(worker): reduce event poll timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
max-niederman committed Apr 23, 2024
1 parent b86cc99 commit 209ec4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/centipede_worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<'r> Worker<'r> {
Ok(())
}

/// Wait for at least one event and handle it.
/// Wait for an event and handle it, or time out after 100ms.
///
/// Mutably borrows an event buffer for scratch space, to avoid reallocating it.
pub fn wait_and_handle(&mut self, events: &mut mio::Events) -> Result<(), Error> {
Expand All @@ -89,7 +89,7 @@ impl<'r> Worker<'r> {

events.clear();
self.poll
.poll(events, Some(Duration::from_secs(1)))
.poll(events, Some(Duration::from_millis(100)))
.map_err(Error::Poll)?;

for event in &*events {
Expand Down

0 comments on commit 209ec4c

Please sign in to comment.