Is it bad practice to emit events with callbacks as arguments in node?
var someonesListened = self.emit('doSomething', param, callback);
if (!someonesListened) {
callback();
}
// in another module somewhere
this.on('doSomething', function(param, callback) {
// Something async....
// Then sometime later
callback();
})
EDIT: After writing this question I realised that by providing a continuation callback to an event that can be intercepted by multiple listeners defeats the purpose so I don't think I will be taking this approach.