Awesome
Example of communication between Sidekiq and Exq
Exq can work alongside Sidekiq. This demo app shows how to construct communication between these tools.
The aim is to have a Sidekiq as a client that creates jobs and Exq a a server that processes these jobs.
There are two applications here:
rails_app
elixir_app
To start you must pass these steps:
- in Rails app:
cd rails_app
bundle install
(loads all dependencies)- rails s (launches rails server on
localhost:3000
by default)
- in Elixir app:
cd elixir_app
mix deps.get
(loads all dependencies)mix run --no-halt
(runs our application and does not halt it so we can seeIO.puts
calls defined inElixirApp.JobWorker
)
curl -X POST -F "job[id]=1" -F "job[title]=test213" -F "job[value]=123" 'http://localhost:3000/jobs'
In console with hanging elixir app you must see JobWorker called with id: 1, title: test213, value: 123