1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Per-queue in-process `Notify` for `JobQueue::wait_for_work`.
//!
//! `SQLite` has no LISTEN/NOTIFY equivalent. We approximate it with a
//! `tokio::sync::Notify` per queue, plus `notify_one` after each
//! enqueue. Because both producers and consumers live in the same
//! process for the `SQLite` backend, this is sufficient — no cross-pod
//! notification needed (that's a Redis/Postgres concern).
//!
//! `notify_one` is used (not `notify_waiters`) so an enqueue that
//! races with all-workers-busy still stores a permit; the next
//! worker to enter the select consumes it.
use HashMap;
use Arc;
use ;
pub