You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
653 B
25 lines
653 B
'use strict';
|
|
|
|
var log = require('npmlog');
|
|
log.debug = log.verbose;
|
|
var inherits = require('inherits');
|
|
var events = require('events');
|
|
var nodeutil = require('util');
|
|
|
|
function EventBroadcaster() {};
|
|
|
|
nodeutil.inherits(EventBroadcaster, events.EventEmitter);
|
|
|
|
EventBroadcaster.prototype.broadcast = function(eventName, serviceInstance, args) {
|
|
this.emit(eventName, serviceInstance, args);
|
|
};
|
|
|
|
var _eventBroadcasterInstance;
|
|
EventBroadcaster.singleton = function() {
|
|
if (!_eventBroadcasterInstance) {
|
|
_eventBroadcasterInstance = new EventBroadcaster();
|
|
}
|
|
return _eventBroadcasterInstance;
|
|
};
|
|
|
|
module.exports = EventBroadcaster.singleton();
|
|
|