#queue #on-disk #unordered #consumed #persistent #multiple #version

diskqueue

Unordered persistent on-disk queue that can be consumed from multiple processes

1 unstable release

0.1.0 Sep 5, 2022

#5 in #consumed

MIT/Apache

12KB
191 lines

(Unordered) queue of items persisted to disk of a given serde-serializable type. The on-disk structure is considered an implementation detail and not a public interface. The data on disk is versioned and an effort is made to not consume incompatible data schemas across versions. Items that can't be consumed (e.g. due to incompatible versions) aren't removed from the queue and might bubble up again.

Example usage:

  # let t = tempfile::tempdir().unwrap();
  # let path = t.path().join("foo").to_path_buf();
  use diskqueue::Queue;
  let q: Queue<i32> = Queue::new(path).unwrap();
  q.enqueue(123).unwrap();
  let v = q.dequeue().unwrap();
  assert_eq!(v, Some(123));

Dependencies

~3–15MB
~158K SLoC