#queue #persistent #async #task-queue


In-app persistent queue for asynchronous jobs

1 unstable release

0.1.0 May 5, 2024

#768 in Asynchronous

31 downloads per month


166 lines


App-queue is a simple persistent in-app queue for Rust. It is designed to be dropped into monolithic applications, and provide automatic queueing and retrying for asynchronous tasks.

Additionally, it allows the use of any serializable data type for requests.

By default, if a job returns an error, it will be retried indefinitely with exponential backoff (600s max delay). This can however be overridden on a per-job-type basis.

Sample usage, from the documentation:

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct MyJob {
    message: String

impl Job for MyJob {
  async fn run(&mut self, _: Arc<AppQueue>) -> Result<()> {
    println!("{}", self.message);

async fn main() -> Result<()> {
# tracing_subscriber::fmt::init();
  let queue = AppQueue::new("/tmp/queue.db").await?;
  let job = MyJob {
    message: "Hello, world!".into()

A larger example can be found here.


Incompatible schema changes (Renaming/Removal of Job structs), as well as incompatible changes in the structure of the job itself will cause jobs to get stuck in the queue. This will cause errors to show up on startup, however they will be ignored for the rest of the program’s runtime.


Potentially desirable features that are currently not supported:

  • Scheduling jobs to run after a certain time (technically capable, but no API exists yet)
  • Prioritization
  • Integration with the app’s storage. The app likely already uses a database, and it would be useful to only have one database total. Proper DBMSes may also improve performance in some cases.


~1M SLoC