Here's some glue for Sidekiq

What is the feature?

One more Woodshop article about gluing your FA back office to your Sidekiq, see code at the bottom.
You may want to make a specific section for your Rails stack.

What problem does this solve for you?

At the moment, killing some meeting time =)
More generally, plugging the back-office to our backend (and our backend ORM) and mailing systems.

Who else would be using this feature?

Anyone having a Sidekiq queuing system in their stack that they want to use in their back-office, for example to run operations in other contexts.

Where’s the code?

Glad you asked, here:

const redis = require("redis");

function enqueueJob(queue, klass, ...args) {
    const client = redis.createClient(process.env.REDIS_URL);

    client.lpush("queue:" + queue, JSON.stringify({
        jid: Math.floor(Math.random() * Math.floor(10000000000000000)).toString(),
        created_at: Date.now() / 1000,
        queue: queue,
        class: klass,
        args: args
    }));
}

module.exports = enqueueJob;

As can be read, you’re going to need the redis package and a REDIS_URL env variable.

Hello @kll ,

I’m pushing this suggestion on our product board! :raised_hands:

All the best,

1 Like