You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a rails demo app the demonstrates how Serially gem can be used to orchestrate background tasks to run serially, one after another, for instances of a model.
Installation
$ bundle
The following generates a migration that creates serially_task_runs table, which would be used to write the results of all your task runs.
# this will start 3 resque workers that will listen to the 'posts' queue
$ bundle exec rake resque:workers QUEUE='posts' COUNT=3 TERM_CHILD=1
Go to localhost:3000, create a new post, and click the Schedule Serially Tasks link next to it. For the sake of an experiment,
you can click the link multiple times, the tasks for the post will still run only once.
View Results
Give it 15 seconds, refresh localhost:3000, and you should see the columns Drafted by, Reviewed by, and Published By filled with values.
Last task columns display info on the last task that ran for each post.
Monitor
Go to localhost:3000/resque to see a job being added to serially queue for every post on which you click Schedule Serially Tasks