UNPKG

lockup

Version:

Lockup uses a certain lock file to queue and deal with inter-process asynchronous resources.

34 lines (24 loc) 450 B
'use strict'; var EE = require('events').EventEmitter; var ev = { __proto__: EE.prototype }; ev.on('a', function () { console.log(1); }); ev.on('a', function () { setTimeout(function () { console.log(2) }, 1000) }); ev.emit('a'); ev.removeAllListeners('a'); ev.on('a', function () { console.log(11); }); ev.on('a', function () { setTimeout(function () { console.log(21) }, 1000) }); ev.emit('a');