Skip to content

Commit

Permalink
select non-writers first
Browse files Browse the repository at this point in the history
  • Loading branch information
losfair committed Dec 17, 2023
1 parent c4c6346 commit c437b7a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sqlite/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,12 @@ impl Sqlite {
let slot = if let Some(x) = self
.workers
.iter()
.skip(1)
.find_map(|x| x.request_tx.try_reserve().ok())
{
x
} else if let Some(x) = self.workers[0].request_tx.try_reserve().ok() {
x
} else {
futures::future::select_all(
self.workers.iter().map(|x| x.request_tx.reserve().boxed()),
Expand Down

0 comments on commit c437b7a

Please sign in to comment.