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
And I'd run heroku scale web=0 scraper=1
to turn it on.
It would also get killed every so often because I'm on the free plan and I'd have to manually restart it each time, since there's no incoming web requests to keep it alive.
Does all that sound correct?