brandonhilkert / sucker_punch

Sucker Punch is a Ruby asynchronous processing library using concurrent-ruby, heavily influenced by Sidekiq and girl_friday.
MIT License
2.64k stars 114 forks source link

How short a job have to be to consider to use sucker punch #245

Closed Augustoagrbr closed 2 years ago

Augustoagrbr commented 2 years ago

Hi @brandonhilkert.

I have some doubts. I have some services that take between 10 to 40 seconds or, in the worst case, 30 to 120 seconds.

I would like to know two things. Are SuckerPunch jobs terminated by heroku dinos in a 30-second request? And the best execution recommendation to consider using...

Anyway, I congratulate you for the great work with the gem!!

brandonhilkert commented 2 years ago

If a Heroku process is running, jobs will be processed. If you enqueue job and it takes 60 sec. and the dyno terminates in 30 sec. That 60 sec. job will be killed prior to completion.

If this is a concern in your application, I'd recommend something like Sidekiq that stores state elsewhere and another work can pick up the work to continue. The README speaks to this idea and suggests only using for non-critical workloads.