Metaserver class. Metaserver acts as a container for multiple semi-independent slave servers of the same server type. Every slave server has its own cache server connection and main worker thread. The client connections pool is common for all slave servers (each client is bound to a single slave server).

Fields

id:Int

Unique metaserver ID. This is just a random number and not counted from zero like the rest of server IDs.

servers:Array<Server>

Slave servers list.

Methods

initServer ():Void

Initializes metaserver state. Must be called before start() in basic mode. Called automatically in uniserver mode.

start ():Void

Starts running this metaserver. Does not return. Must be called after initServer() in basic mode. Called automatically in uniserver mode.

workByClientID (clientID:Int, type:String, params:Dynamic):Void

This method will make a call on the slave server (belonging to this metaserver) that has the client with given ID connected.

Parameters:

clientID

Client ID.

type

Request name. Supports the <module>.<method> naming scheme.

params

Request parameters.