Skip to content

Instantly share code, notes, and snippets.

Let's say I make a piece of Clojure code that does something other than serve a website.

Example: a loop that checks twitter every 10 minutes for mentions of some product and emails them to me. You'd start it with lein run and it would run until killed, (Thread/sleep 1000)ing when it doesn't need to work.

Can I host this kind of thing, standalone, on Heroku? With the free plan?

So far it seems like the answer is yes. I just name it something other than 'web' in the procfile (so Heroku doesn't expect it to bind to a port) and then scale it to one process. So the procfile looks like:

scraper: lein run