Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-j97 committed Dec 20, 2024
1 parent 2b7ab13 commit ac2d7d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/tx-ssi-mpmc-queue/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ac2d7d8

Please sign in to comment.