Now that we have defined our workflow and its jobs, we can use it:
Important: The command to start background workers depends on the backend you chose for ActiveJob. For example, in case of Sidekiq this would be:
bundle exec sidekiq -q gush
Click here to see backends section in official ActiveJob documentation about configuring backends
Hint: gush uses gush
queue name by default. Keep that in mind, because some backends (like Sidekiq) will only run jobs from explicitly stated queues.
flow = PokemonWorkflow.new
flow.start!
Now Gush will start processing jobs in the background using ActiveJob and your chosen backend.
flow.reload
flow.status
#=> :running|:finished|:failed
reload
is needed to see the latest status, since workflows are updated asynchronously.