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_appelixir_app
To start you must pass these steps:
- in Rails app:
cd rails_appbundle install(loads all dependencies)- rails s (launches rails server on
localhost:3000by default)
- in Elixir app:
cd elixir_appmix deps.get(loads all dependencies)mix run --no-halt(runs our application and does not halt it so we can seeIO.putscalls 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