Use crossbeam channel

This commit is contained in:
Lukas Wirth 2025-05-24 09:42:41 +02:00 committed by Lukas Wirth
parent 713eb34fef
commit 66c99bee61
2 changed files with 4 additions and 4 deletions

View file

@ -15,6 +15,7 @@ salsa-macros = { version = "0.22.0", path = "components/salsa-macros", optional
boxcar = "0.2.13"
crossbeam-queue = "0.3.11"
crossbeam-utils = "0.8.21"
crossbeam-channel = "0.5.15"
dashmap = { version = "6", features = ["raw-api"] }
# the version of hashbrown used by dashmap
hashbrown_14 = { version = "0.14", package = "hashbrown" }
@ -53,7 +54,6 @@ salsa-macros = { version = "=0.22.0", path = "components/salsa-macros" }
[dev-dependencies]
# examples
crossbeam-channel = "0.5.14"
dashmap = { version = "6", features = ["raw-api"] }
eyre = "0.6.8"
notify-debouncer-mini = "0.4.1"

View file

@ -103,12 +103,12 @@ pub fn run_memo_drops(receiver: &MemoDropReceiver) {
}
pub fn memo_drop_channel() -> (MemoDropSender, MemoDropReceiver) {
let (tx, rx) = std::sync::mpsc::channel();
let (tx, rx) = crossbeam_channel::unbounded();
(MemoDropSender(tx), MemoDropReceiver(rx))
}
#[derive(Clone)]
pub struct MemoDropSender(std::sync::mpsc::Sender<MemoDropAction>);
pub struct MemoDropSender(crossbeam_channel::Sender<MemoDropAction>);
impl MemoDropSender {
/// Put the memo into the drop queue.
@ -134,7 +134,7 @@ impl MemoDropSender {
}
}
pub struct MemoDropReceiver(std::sync::mpsc::Receiver<MemoDropAction>);
pub struct MemoDropReceiver(crossbeam_channel::Receiver<MemoDropAction>);
/// A drop action to be performed by the owner of the `MemoDropReceiver`.
#[derive(Debug)]