aboutsummaryrefslogtreecommitdiff
path: root/src/bayou.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-11-17 10:46:13 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-11-17 10:46:13 +0100
commit7eb690e49dd995663e8ea35b1a1f5b14584b4509 (patch)
treeca6f5a3dd2be863c2d4060f791065998b446215c /src/bayou.rs
parent6da8b815b694a37d39a2be04c8e1585aac17954a (diff)
downloadaerogramme-7eb690e49dd995663e8ea35b1a1f5b14584b4509.tar.gz
aerogramme-7eb690e49dd995663e8ea35b1a1f5b14584b4509.zip
introduce an "orphan" enum
Diffstat (limited to 'src/bayou.rs')
-rw-r--r--src/bayou.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bayou.rs b/src/bayou.rs
index f95bd82..d3027c5 100644
--- a/src/bayou.rs
+++ b/src/bayou.rs
@@ -443,7 +443,7 @@ impl<S: BayouState> Bayou<S> {
struct K2vWatch {
pk: String,
sk: String,
- rx: watch::Receiver<storage::RowRef>,
+ rx: watch::Receiver<storage::OrphanRowRef>,
notify: Notify,
}
@@ -454,7 +454,7 @@ impl K2vWatch {
fn new(creds: &Credentials, pk: String, sk: String) -> Result<Arc<Self>> {
let row_client = creds.row_client()?;
- let (tx, rx) = watch::channel::<storage::RowRef>(row_client.row(&pk, &sk));
+ let (tx, rx) = watch::channel::<storage::OrphanRowRef>(row_client.row(&pk, &sk).to_orphan());
let notify = Notify::new();
let watch = Arc::new(K2vWatch { pk, sk, rx, notify });
@@ -471,7 +471,7 @@ impl K2vWatch {
async fn background_task(
self_weak: Weak<Self>,
k2v: storage::RowStore,
- tx: watch::Sender<storage::RowRef>,
+ tx: watch::Sender<storage::OrphanRowRef>,
) {
let mut row = match Weak::upgrade(&self_weak) {
Some(this) => k2v.row(&this.pk, &this.sk),
@@ -497,7 +497,7 @@ impl K2vWatch {
}
Ok(new_value) => {
row = new_value.to_ref();
- if tx.send(XXX).is_err() {
+ if tx.send(row.to_orphan()).is_err() {
break;
}
}