diff --git a/lib/server.js b/lib/server.js index 7da2c47..3936d41 100644 --- a/lib/server.js +++ b/lib/server.js @@ -133,6 +133,14 @@ Barnacles.prototype.addService = function(options) { } } +/** + * Add a service instance to notify. This brings more flexibility to insert any service from the callsite. + * @param {String} name A name to identify the service on the list of services. + * @param {Object} service A instance of a customized service. + */ +Barnacles.prototype.addServiceInstance = function(name, service) { + this.services[name] = service; +} /** * Get the current state of events.