Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by

In Ruby on Rails they have ActiveJob for implementing background jobs. Examples include delayed_job, resque, etc.

Is there something similar in Clojure?

Basically, I want to have a REST end-point invocation which queues a long-running task to be run. Though it returns something like a job id immediately, not waiting for the task to finish. The task should continue to run in the background until it completes.

1 Answer

+1 vote
selected by
Best answer

There's Proletarian, which I made for exactly the use cases that delayed_job and Resque support. There's no REST interface, though - you enqueue jobs by invoking a function that writes to the job table. It's backed by Postgres, and can partake in Postgres transaction that you already use. This gives you guarantees that HTTP-based or Redis-based solutions can't, namely that the job is atomically persisted along with whatever other business data that was persisted in the transaction.

Thanks, this looks promising. I am using Postgres in my scenario.