This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {Queue} = require('bullmq'); | |
const sendQueue = new Queue('Send', { connection: '127.0.0.1'}); | |
///... | |
// Add job to queue | |
sendQueue.add('send', { job: 'data' }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {Worker} = require('bullmq'); | |
const worker = new Worker('Send', async job => { | |
const sendData = job.data; | |
//Send stuff | |
return something; // return is not required here, as we use async function. | |
}, {concurrency: 1, {connection: { host: '127.0.0.1' } }}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {QueueScheduler} = require('bullmq'); | |
const sendScheduler = new QueueScheduler('Send', {connection: {host: '127.0.0.1' } }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT endpoint, auth, p256dh, ... FROM users WHERE id IN (...); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT id FROM users WHERE id > 0 AND country IN ('IN', 'ID'... ) AND subscription_timestamp < 1640210030 ORDER BY id LIMIT 100000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT id FROM users_map_IN WHERE id > 0 AND ts < 1640210030 LIMIT 100000; |