I'm trying to queue a Sidekiq worker that does not exist in my project but exists in some other project sharing the same redis server.
In our current situation, we have two servers:
API server runs on Heroku. Web instance for the REST API and worker with Sidekiq listening to the
:api
queue.Processing server runs on AWS ElasticBeanstalk with a puma instance running a REST Full API with Sinatra. This instance runs Sidekiq and listens to the queue
:processing
Side note: In the beginning, our API was doing all the work but as some workers started taking too much memory, we switch to the processing server.
When we need to execute a job on the processing server we have these actions happening:
API calls
POST processing.com/some_job
Processing queues
SomeJobWorker
on queueprocessing
Processing executes
SomeJobWorker
from queueprocessing
Processing calls
POST api.com/webhooks/some_job_result
API queues
SomeJobResultWorker
on queueapi
API executes
SomeJobResultWorker
from queueprocessing
This got me thinking if I could somehow, from the API server directly queue SomeJobWorker
then I could get rid of the REST API on our processing server.
... then I could get rid of the webhooks
endpoint on the API server and do the same from the processing server
I would end up with something like this:
API calls queues
SomeJobWorker
Processing executes
SomeJobWorker
Processing queues
SomeJobResultWorker
API executes
SomeJobResultWorker
Is there a way for me to queue a worker that does not exist on my local code base?