diff --git a/examples/tx-ssi-mpmc-queue/src/main.rs b/examples/tx-ssi-mpmc-queue/src/main.rs index 8a9e354..37de49b 100644 --- a/examples/tx-ssi-mpmc-queue/src/main.rs +++ b/examples/tx-ssi-mpmc-queue/src/main.rs @@ -65,13 +65,14 @@ fn main() -> fjall::Result<()> { // Something like SingleDelete https://github.com/facebook/rocksdb/wiki/Single-Delete // would be good for this type of workload if let Some((key, _)) = tx.first_key_value(&tasks)? { - tx.remove(&tasks, &key); + let task_id = std::str::from_utf8(&key).unwrap().to_owned(); + + tx.remove(&tasks, key); if tx.commit()?.is_ok() { counter.fetch_add(1, Relaxed); } - let task_id = std::str::from_utf8(&key).unwrap(); println!("consumer {idx} completed task {task_id}"); let ms = rng.gen_range(50..200);