chaps-io / gush

Fast and distributed workflow runner using ActiveJob and Redis
MIT License
1.03k stars 103 forks source link

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

Closed KirillSuhodolov closed 6 years ago

KirillSuhodolov commented 6 years ago

Need it for testing and debugging complex workflows in same runtime

pokonski commented 6 years ago

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

KirillSuhodolov commented 6 years ago

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

pokonski commented 6 years ago

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.

pokonski commented 6 years ago

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