We have a Node application, and a portion of the Node code runs as a background job. The job is using BullMQ, which is written in JavaScript and uses Redis under the hood.
We are in the process of porting some Node application to Rails. But, I'd like to keep the background job, written in Node as it is.
Is it possible to have:
- A route in Rails, accept a request, schedule a job and push it to a Redis queue?
- Have the job processed by a worker written in Node/JavaScript?
- Have Rails listen to the Queue (Websockets or long polling) and send result to browser when complete?
Another words is there an language independent Redis / Queue system?
+-------------+
| |
| |
| REDIS QUEUE |
+----------------+ |
| | |
| | +^--+
| +---------------+ |
+---------+ | ^ | |
| | +-------v--+ | | |
| browser +--------------+ +--------------------+ | |
| <--------------+ Rails | | |
+---------+ | | | |
+----------+ +---------v----+
| |
| |
| NODE worker |
| |
| |
+--------------+
I am more familiar with Jobs/Queue in Node than in Rails. I saw a lot of options like SideKick and Resque, but it seems that the workers are mostly written in Ruby.