Skip to content

Instantly share code, notes, and snippets.

@nicoayala
nicoayala / concurrentQueue.js
Created March 20, 2019 19:30
Bull queue concurrency example
import Queue from 'bull'; // Using https://github.com/OptimalBits/bull/tree/v3.4.8
const url = 'redis://127.0.0.1:6379';
const prefix = 'queue-app';
export const createQueue = name => new Queue(name, url, {
prefix: `${prefix}:jobs`,
defaultJobOptions: {
backoff: { type: 'linear' },
attempts: 20,
# The install script
# Adapted from https://gist.github.com/579814
install_path=local
download_path=Downloads/node-latest-install
echo '# Added by install script for node.js and npm in 30s' >> ~/.bashrc
echo 'export PATH=$HOME/'$install_path'/bin:$PATH' >> ~/.bashrc
echo 'export NODE_PATH=$HOME/'$install_path'/lib/node_modules' >> ~/.bashrc
. ~/.bashrc