Class: BaseService

Creates an instance of the Base Service of which all service must inherit. Services are spawned from your service.json file and managed by a helper thread (Service Manager). Services communicate their status and receive status of other service through the Service Manager. Services have an intial handshake with the Service Manager on load and then either go online or wait for dependant services to come online. Service intialization is completly async which allows all services to load at the same time as long as their dependencies have been met.

new BaseService
(params)

services/baseService.js, line 35
Name Type Description
params Object
Name Type Description
name String

The name of the service

Example
var baseService = require("../baseService");
	function NewService() {

		return this;
	}
	NewService.prototype = new baseService('NewService');
	var serviceInstance = new NewService();
	serviceInstance.setOnConnectionComplete(function (callback) {
		callback();
	});

	serviceInstance.start();
	module.exports = serviceInstance;

Members

RouterClientstring

The name of the service

statuss

Service status

Methods

addNeededClients
(services)

services/baseService.js, line 108

Add a client to clients needed list. This clientz will wait for all clients in this list to be complete.

Name Type Description
services Array

An array of service names

addNeededServices
(services)

services/baseService.js, line 93

Add a service to services needed list. This service will wait for all services in this list to be complete.

Name Type Description
services Array

An array of service names

clearServicesNeeded
(services)

services/baseService.js, line 124

Clear the services needed. By default, routerClient is in the required service

Name Type Description
services Array

Add a service to services needed list. This service will wait for all services in this list to be complete.

start
()

services/baseService.js, line 262

Starts the service.