Class: BaseClient

Base Client


The Base Client is inherited by every client to provide common functionality to the clients. Clients communicate their status to each other through the Router and receive service status from the service manager. Once all dependecies are met, either client or service, the client's onReady method is fired.

new BaseClient
(params)

clients/baseClient.js, line 37
Name Type Description
params Object
Name Type Description
onReady function

A function to be called after the client has initialized.

name String

The name of the client

Example
var BaseClient = require("./baseClient");
	var NewClient = function (params) {
		BaseClient.call(this, params);
		var self = this;

		return this;
	};

	var clientInstance = new NewClient({
		onReady: function (cb) {
			console.log("NewClient Online");
			cb();
		},
		name:"NewClient"
	});
	clientInstance.requiredServices = [REPLACE_THIS_ARRAY_WITH_DEPENENCIES];
	clientInstance.initialize();
	module.exports = clientInstance;

Members

finWindowobject

Gets the current window

onlineClientsarrays

A list of online clients

onlineServicesarrays

A list of online services

requiredClientsarray

Clients the are required to be online before the service can come online

requiredServicesarray

Services the are required to be online before the service can come online

routerClientObject

Reference to the RouterClient

windowNamestring

Gets the cusrrent window name

Methods

addServices
(services)

clients/baseClient.js, line 87

This is where services that are required are set

Name Type Description
services Array

A list of services by name that are required for this client

initialize
()

clients/baseClient.js, line 157

Starts the process of checking services and any other function required before the client can come online