chaps-io/gush

How can I run workflow synchronously(each job with perform_now method)?

KirillSuhodolov opened this issue · 4 comments

Need it for testing and debugging complex workflows in same runtime

Simply set the backend to one of the backends ActiveJob provides => see the link I added in README http://guides.rubyonrails.org/v4.2/active_job_basics.html#backends

You could for example set the backend to inline in your Rails config:

config.active_job.queue_adapter = :inline

and what about, some of them sync and some of them async? Not changing global settings?

You can set it in scope of your spec and revert to original at the end. ActiveJob has one global configuration so it's not Gush specific.

In integration tests for Gush I set the adapter to :test https://github.com/chaps-io/gush/blob/master/spec/spec_helper.rb#L6