Skip to content

Instantly share code, notes, and snippets.

View ORESoftware's full-sized avatar
🏐
Focusing

Alexander Mills ORESoftware

🏐
Focusing
View GitHub Profile
// import opq
const Queue = require('opq');
// below we create a new client to the queue,
// and create the queue on the filesystem if it does
// not exist. the port is used by Live-Mutex;
// fp is our queue filepath
const q = new Queue({
@ORESoftware
ORESoftware / async-constructor.js
Last active January 14, 2017 03:53
An asynchronous constructor pattern
// asynchronous constructor example,
// like always do not explictly return anything from the constructor
function Queue(){
this.ready = false;
let callable = true;
let ee = new EE(); // new event emitter