Options
All
  • Public
  • Public/Protected
  • All
Menu

pinus

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

AConfigureFunc1

AConfigureFunc1: function

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

AConfigureFunc2

AConfigureFunc2: function

Type declaration

    • (env: string): Promise<void>
    • Parameters

      • env: string

      Returns Promise<void>

AConfigureFunc3

AConfigureFunc3: function

Type declaration

    • (env: string, type: string): Promise<void>
    • Parameters

      • env: string
      • type: string

      Returns Promise<void>

AfterHandlerFilter

AfterHandlerFilterFunction

AfterHandlerFilterFunction: function

Type declaration

BeforeHandlerFilter

BeforeHandlerFilterFunction

BeforeHandlerFilterFunction: function

Type declaration

BeforeStopHookFunction

BeforeStopHookFunction: function

Type declaration

    • (app: Application, shutDown: function, cancelShutDownTimer: function): void
    • Parameters

      • app: Application
      • shutDown: function
          • (): void
          • Returns void

      • cancelShutDownTimer: function
          • (): void
          • Returns void

      Returns void

BlackListFunction

BlackListFunction: function

Type declaration

    • (process: function): void
    • Parameters

      • process: function
          • (err: Error, list: string[]): void
          • Parameters

            • err: Error
            • list: string[]

            Returns void

      Returns void

ConfigureCallback

ConfigureCallback: function

Type declaration

    • (): void
    • Returns void

CountDownLatchCallback

CountDownLatchCallback: function

Type declaration

    • (isTimeout?: boolean): void
    • Parameters

      • Optional isTimeout: boolean

      Returns void

FRONTENDID

FRONTENDID: string

FrontendOrBackendSession

FrontendOrBackendSession: FrontendSession | BackendSession

Handler

Handler: object

Type declaration

HandlerCallback

HandlerCallback: function

Type declaration

    • (err: Error, response?: any): void
    • Parameters

      • err: Error
      • Optional response: any

      Returns void

HandlerMap

HandlerMap: object

Type declaration

HandlerMethod

HandlerMethod: function

Type declaration

Handlers

Handlers: object

Type declaration

HanshakeFunction

HanshakeFunction: function

Type declaration

    • (msg: any, cb: function, socket: ISocket): void
    • Parameters

      • msg: any
      • cb: function
          • (err?: Error, resp?: any): void
          • Parameters

            • Optional err: Error
            • Optional resp: any

            Returns void

      • socket: ISocket

      Returns void

IDecoder

IDecoder: function

Type declaration

    • (msg: any): object
    • Parameters

      • msg: any

      Returns object

      • body: any
      • id: number
      • route: string

IEncoder

IEncoder: function

Type declaration

    • (reqId: number, route: string, msg: any): object | any
    • Parameters

      • reqId: number
      • route: string
      • msg: any

      Returns object | any

IPushSchedulerOptions

IPushSchedulerOrCtor

IPushSchedulerOrCtor: object | IPushScheduler

IPushSelector

IPushSelector: function

Type declaration

    • (reqId: number, route: string, msg: any, recvs: number[], opts: any): number
    • Parameters

      • reqId: number
      • route: string
      • msg: any
      • recvs: number[]
      • opts: any

      Returns number

MasterServerOptions

MasterServerOptions: object & Partial<ConsoleServiceOpts>

ObjectType

ObjectType: object

Represents some Type of the Object.

Type declaration

RouteCallback

RouteCallback: function

Type declaration

    • (err: Error, routeToServerId?: string): void
    • Parameters

      • err: Error
      • Optional routeToServerId: string

      Returns void

RouteFunction

RouteFunction: function

Type declaration

RouteMaps

RouteMaps: object

Type declaration

SID

SID: number

ServerOptions

ServerOptions: HandlerServiceOptions

TransactionCondictionFunction

TransactionCondictionFunction: function

Type declaration

    • (cb: function): void
    • Parameters

      • cb: function
          • (err?: Error): void
          • Parameters

            • Optional err: Error

            Returns void

      Returns void

TransactionHandlerFunction

TransactionHandlerFunction: function

Type declaration

    • (cb: function): void
    • Parameters

      • cb: function
          • (err?: Error): void
          • Parameters

            • Optional err: Error

            Returns void

      Returns void

UID

UID: string

Variables

CLEAN_SESSION_MASK

CLEAN_SESSION_MASK: number = 2

CMD_MASK

CMD_MASK: number = 240

CMD_SHIFT

CMD_SHIFT: number = 4

CODE_OK

CODE_OK: number = 200

CODE_OLD_CLIENT

CODE_OLD_CLIENT: number = 501

CODE_USE_ERROR

CODE_USE_ERROR: number = 500

DEFAULT_FLUSH_INTERVAL

DEFAULT_FLUSH_INTERVAL: number = 20

DEFAULT_MAXLAG

DEFAULT_MAXLAG: number = 70

DEFAULT_SIZE

DEFAULT_SIZE: number = 500

DEFAULT_TIMEOUT

DEFAULT_TIMEOUT: number = 3000

DUP_MASK

DUP_MASK: number = 8

EXPORTED_FIELDS

EXPORTED_FIELDS: string[] = ['id', 'frontendId', 'uid', 'settings']

EXPORTED_SESSION_FIELDS

EXPORTED_SESSION_FIELDS: string[] = ['id', 'frontendId', 'uid', 'settings']

FRONTEND_SESSION_FIELDS

FRONTEND_SESSION_FIELDS: string[] = ['id', 'frontendId', 'uid', '__sessionService__']

HEAD_SIZE

HEAD_SIZE: number = 4

HTTP_METHODS

HTTP_METHODS: string[] = ['GET', 'POST', 'DELETE', 'PUT', 'HEAD']

LENGTH_FIN_MASK

LENGTH_FIN_MASK: number = 128

LENGTH_MASK

LENGTH_MASK: number = 127

PASSWORD_MASK

PASSWORD_MASK: number = 64

PKG_HEAD_BYTES

PKG_HEAD_BYTES: number = PKG_ID_BYTES + PKG_ROUTE_LENGTH_BYTES

PKG_ID_BYTES

PKG_ID_BYTES: number = 4

PKG_ROUTE_LENGTH_BYTES

PKG_ROUTE_LENGTH_BYTES: number = 1

Package

Package: any = require('../../package')

QOS_MASK

QOS_MASK: number = 3

QOS_SHIFT

QOS_SHIFT: number = 1

RETAIN_MASK

RETAIN_MASK: number = 1

STATE_INITED

STATE_INITED: number = 1

Application states

STATE_START

STATE_START: number = 2

STATE_STARTED

STATE_STARTED: number = 3

STATE_STOPED

STATE_STOPED: number = 4

ST_BODY

ST_BODY: number = 2

ST_CLOSED

ST_CLOSED: number = 2

ST_DESTROYED

ST_DESTROYED: number = 1

ST_HEAD

ST_HEAD: number = 1

Work states

ST_INITED

ST_INITED: number = 0

constant

ST_STARTED

ST_STARTED: number = 1

ST_STOPED

ST_STOPED: number = 2

ST_WAIT_ACK

ST_WAIT_ACK: number = 1

ST_WORKING

ST_WORKING: number = 2

USERNAME_MASK

USERNAME_MASK: number = 128

WILL_FLAG_MASK

WILL_FLAG_MASK: number = 4

WILL_QOS_MASK

WILL_QOS_MASK: number = 24

WILL_QOS_SHIFT

WILL_QOS_SHIFT: number = 3

WILL_RETAIN_MASK

WILL_RETAIN_MASK: number = 32

adminLogger

adminLogger: Logger = getLogger('admin-log', __filename)

codes

codes: object

Type declaration

  • [key: string]: number

conLogger

conLogger: Logger = getLogger('con-log', __filename)

cpus

cpus: object

Type declaration

  • [serverId: string]: number

crashLogger

crashLogger: Logger = getLogger('crash-log', __filename)

curId

curId: number = 1

env

env: string = Constants.RESERVED.ENV_DEV

forwardLogger

forwardLogger: Logger = getLogger('forward-log', __filename)

handlers

handlers: object

Type declaration

  • [packageType: number]: function
      • (socket: ISocket, pkg: any): void
      • Parameters

        Returns void

httpServer

httpServer: Server = createServer()

localIps

localIps: string[] = function (){let ifaces = os.networkInterfaces();let ips : string[] = [];let func = function (details : os.NetworkInterfaceInfo){if (details.family === 'IPv4'){ips.push(details.address);}};for (let dev in ifaces){ifaces[dev].forEach(func);}return ips;}()

logger

logger: Logger = getLogger('forward-log', __filename)

pinus

pinus: Pomelo = new Pomelo()

promisify

promisify: promisify = util.promisify

queues

queues: object

Type declaration

rpcLogger

rpcLogger: Logger = getLogger('rpc-log', __filename)

rsa

rsa: any = require("node-bignumber")

sequeue

sequeue: any = require('seq-queue')

timeout

timeout: number = 3000

toobusy

toobusy: any = null

transactionErrorLogger

transactionErrorLogger: Logger = getLogger('transaction-error-log', __filename)

transactionLogger

transactionLogger: Logger = getLogger('transaction-log', __filename)

Functions

BackendSessionCB

add

  • add(uid: UID, sid: FRONTENDID, groups: object): boolean
  • add(app: Application, agent: MasterAgent, msg: any, cb: MasterCallback): void
  • add uid and sid into group. ignore any uid that uid not specified.

    Parameters

    • uid: UID

      user id

    • sid: FRONTENDID

      server id

    • groups: object

      grouped uids, , key: sid, value: [uid]

      • [sid: string]: UID[]

    Returns boolean

  • add uid and sid into group. ignore any uid that uid not specified.

    Parameters

    • app: Application
    • agent: MasterAgent
    • msg: any
    • cb: MasterCallback

    Returns void

addCron

  • addCron(app: Application, agent: MasterAgent, msg: any, cb: MasterCallback): void

addFilter

  • addFilter<T>(app: Application, type: string, filter: T): void

addServer

addServers

addTask

  • addTask(key: number, fn: function, ontimeout: function, timeoutMs: number): void
  • Add tasks into task group. Create the task group if it dose not exist.

    Parameters

    • key: number

      task key

    • fn: function

      task callback

    • ontimeout: function

      task timeout callback

        • (): void
        • Returns void

    • timeoutMs: number

    Returns void

addToStore

afterFilter

arrayDiff

  • arrayDiff<T>(array1: Array<T>, array2: Array<T>): T[]
  • Compare the two arrays and return the difference.

    Type parameters

    • T: string

    Parameters

    • array1: Array<T>
    • array2: Array<T>

    Returns T[]

beforeFilter

bindCpu

  • bindCpu(sid: string, pid: string, host: string): void
  • Bind process with cpu

    Parameters

    • sid: string

      server id

    • pid: string

      process id

    • host: string

      server host

    Returns void

blacklist

  • blacklist(app: Application, agent: MasterAgent, msg: any, cb: MasterCallback): void

checkAndAdd

checkCluster

  • checkCluster(msg: any): boolean

checkPort

  • checkPort(server: ServerInfo, cb: MasterCallback): void
  • Check if server is exsit.

    Parameters

    • server: ServerInfo
    • cb: MasterCallback

    Returns void

checkTypeData

  • checkTypeData(data: number): boolean

clone

  • clone(src: any, dest: any, includes: any): void

closeQueue

  • closeQueue(key: number, force: boolean): void

composePush

  • composePush(server: any, route: string, msgBody: any): any
  • composePush(route: string, msgBody: any): string
  • composePush(route: string, msgBody: any): Buffer

composeResponse

  • composeResponse(server: any, msgId: number, route: string, msgBody: any): any
  • composeResponse(msgId: number, route: string, msgBody: any): object
  • composeResponse(msgId: number, route: string, msgBody: any): object

configLogger

configure

containCron

  • containCron(id: string, crons: Cron[]): boolean

contains

  • contains(str: string, settings: string): boolean

create

createCountDownLatch

dclone

  • dclone(src: any): any

decode

  • decode(this: any, msg: any): any

default

  • default(socket: ISocket, pkg: any): void
  • Remote service for backend servers. Receive and handle request message forwarded from frontend server.

    Parameters

    Returns void

defaultConfiguration

defaultRoute

deleteFrom

doForward

doHandle

encode

  • encode(this: IConnector, reqId: number, route: string, msg: any): any

encodeBatch

  • encodeBatch(msgs: any[]): string

encodeBody

  • encodeBody(server: any, route: string, msgBody: any): any

endsWith

  • endsWith(str: string, suffix: string): boolean
  • Check a string whether ends with another string

    Parameters

    • str: string
    • suffix: string

    Returns boolean

extendsObject

  • extendsObject(origin: any, add: any): any

finishStart

format

  • format(date: Date, format?: string): string
  • Parameters

    • date: Date
    • Optional format: string

    Returns string

genKey

  • genKey(peer: RemoteInfo): string
  • genKey(self: ChannelService, name?: string): string

genProxies

  • genProxies(client: RpcClient, app: Application, sinfos: ServerInfo[]): void
  • Generate proxy for the server infos.

    Parameters

    • client: RpcClient

      rpc client instance

    • app: Application

      application context

    • sinfos: ServerInfo[]

      server info list

    Returns void

genRouteFun

  • genRouteFun(): (Anonymous function)

genRpcClient

  • genRpcClient(app: Application, opts: RpcClientOpts & object): RpcClient
  • Generate rpc client

    Parameters

    • app: Application

      current application context

    • opts: RpcClientOpts & object

      contructor parameters for rpc client

    Returns RpcClient

    rpc client

genValue

gen_length

  • gen_length(length: number): number[]

gen_number

  • gen_number(num: number): number[]

gen_string

  • gen_string(str: string, without_length?: boolean): number[]

getConnector

getCronPath

  • getCronPath(appBase: string, serverType: string): string
  • Get user remote cron path

    Parameters

    • appBase: string

      application base path

    • serverType: string

      server type

    Returns string

    path string if the path exist else null

getDefaultConnector

getHandlerPath

  • getHandlerPath(appBase: string, serverType: string): string
  • Get handler path

    Parameters

    • appBase: string

      application base path

    • serverType: string

      server type

    Returns string

    path string if the path exist else null

getLogPath

  • getLogPath(appBase: string): string
  • Get logs path.

    Parameters

    • appBase: string

      application base path

    Returns string

    logs path string

getProxyRecords

  • getProxyRecords(app: Application, sinfo: ServerInfo): RemoteServerCode[]
  • Get proxy path for rpc client. Iterate all the remote service path and create remote path record.

    Parameters

    • app: Application

      current application context

    • sinfo: ServerInfo

      server info, format: {id, serverType, host, port}

    Returns RemoteServerCode[]

    remote path record array

getResp

  • getResp(args: any): any[]

getScheduler

getScriptPath

  • getScriptPath(appBase: string): string
  • Get admin script root path.

    Parameters

    • appBase: string

      application base path

    Returns string

    script path string

getSysRemotePath

  • getSysRemotePath(role: string): string
  • Get system remote service path

    Parameters

    • role: string

      server role: frontend, backend

    Returns string

    path string if the path exist else null

getUserRemotePath

  • getUserRemotePath(appBase: string, serverType: string): string
  • Get user remote service path

    Parameters

    • appBase: string

      application base path

    • serverType: string

      server type

    Returns string

    path string if the path exist else null

handle

  • handle(socket: ISocket, reason: string): void

handleData

  • handleData(socket: ISocket, pkg: any): void

handleError

handleHandshake

  • handleHandshake(socket: ISocket, pkg: any): void

handleHandshakeAck

  • handleHandshakeAck(socket: ISocket, pkg: any): void

handleHeartbeat

  • handleHeartbeat(socket: ISocket, pkg: any): void

hasChineseChar

  • hasChineseChar(str: string): boolean
  • check if has Chinese characters.

    Parameters

    • str: string

    Returns boolean

hasProxy

  • hasProxy(client: RpcClient, sinfo: ServerInfo): boolean
  • Check a server whether has generated proxy before

    Parameters

    • client: RpcClient

      rpc client instance

    • sinfo: ServerInfo

      server info

    Returns boolean

    true or false

headHandler

  • headHandler(headBuffer: Buffer): number

inLocal

  • inLocal(host: string): boolean

initFilter

initHandler

invokeCallback

  • invokeCallback(cb: Function, ...args: any[]): any
  • Invoke callback with check

    Parameters

    • cb: Function
    • Rest ...args: any[]

    Returns any

isHttp

  • isHttp(data: Buffer): boolean

isLocal

  • isLocal(host: string): boolean

isObject

  • isObject(arg: any): boolean

isReady

  • isReady(info: any): boolean

kill

  • kill(pids: string[], servers: ServerInfo[]): void
  • kill(app: Application, agent: MasterAgent, msg: any, cb: MasterCallback): void
  • Kill application in all servers

    Parameters

    • pids: string[]

      array of server's pid

    • servers: ServerInfo[]

    Returns void

  • Parameters

    • app: Application
    • agent: MasterAgent
    • msg: any
    • cb: MasterCallback

    Returns void

list

  • list(app: Application, agent: MasterAgent, msg: any, cb: MasterCallback): void

listUserRemoteDir

  • listUserRemoteDir(appBase: string): string[]
  • List all the subdirectory names of user remote directory which hold the codes for all the server types.

    Parameters

    • appBase: string

      application base path

    Returns string[]

    all the subdiretory name under servers/

loadAllFromStore

  • loadAllFromStore(self: ChannelService, key: string, cb: function): void

loadCluster

  • loadCluster(app: Application, server: ServerInfo, serverMap: object): void
  • Load cluster server.

    Parameters

    • app: Application
    • server: ServerInfo
    • serverMap: object
      • [serverId: string]: ServerInfo

    Returns void

loadCronHandlers

loadCrons

loadDefaultComponents

loadLifecycle

loadMaster

loadModules

  • loadModules(self: object, consoleService: ConsoleService): void
  • Load admin modules

    Parameters

    • self: object
    • consoleService: ConsoleService

    Returns void

loadServers

localrun

  • localrun(cmd: string, host: string, options: string[], callback?: function): void
  • Run local command.

    Parameters

    • cmd: string
    • host: string
    • options: string[]
    • Optional callback: function
        • (err?: string | number): void
        • Parameters

          • Optional err: string | number

          Returns void

    Returns void

optComponents

  • optComponents(comps: IComponent[], method: string, cb: function): void
  • Apply command to loaded components. This method would invoke the component {method} in series. Any component {method} return err, it would return err directly.

    Parameters

    • comps: IComponent[]

      loaded component list

    • method: string

      component lifecycle method name, such as: start, stop

    • cb: function
        • (err?: Error): void
        • Parameters

          • Optional err: Error

          Returns void

    Returns void

optLifecycles

  • Parameters

    • comps: ILifeCycle[]
    • method: string
    • app: Application
    • cb: function
        • (err?: Error): void
        • Parameters

          • Optional err: Error

          Returns void

    • Optional arg2: any

    Returns void

parseArgs

  • parseArgs(msg: any, info: any, cb: function): object
  • parseArgs(args: string[]): any
  • Parameters

    • msg: any
    • info: any
    • cb: function
        • (err?: string | Error, data?: any): void
        • Parameters

          • Optional err: string | Error
          • Optional data: any

          Returns void

    Returns object

    • [key: string]: string
  • Parameters

    • args: string[]

    Returns any

parseIntField

  • parseIntField(str: string, offset: number, len: number): number

parseRoute

  • Parse route string.

    Parameters

    • route: string

      route string, such as: serverName.handlerName.methodName

    Returns RouteRecord

    parse result object or null for illeagle route string

ping

  • ping(host: string, cb: function): void
  • Ping server to check if network is available

    Parameters

    • host: string
    • cb: function
        • (ret: boolean): void
        • Parameters

          • ret: boolean

          Returns void

    Returns void

processArgs

processError

  • processError(socket: ISocket, code: number): void

publish

  • publish(opts: any): Buffer

query

randint

  • randint(): number

record

registerDefaultModules

  • registerDefaultModules(isMaster: boolean, app: Application, closeWatcher: boolean): void

remotePathRecord

  • remotePathRecord(namespace: string, serverType: string, path: string): RemoteServerCode
  • Compose remote path record

    Parameters

    • namespace: string

      remote path namespace, such as: 'sys', 'user'

    • serverType: string
    • path: string

      remote service source path

    Returns RemoteServerCode

    remote path record

removeAllFromStore

removeCron

  • removeCron(app: Application, agent: MasterAgent, msg: any, cb: MasterCallback): void

removeFromStore

  • removeFromStore(self: ChannelService, key: string, value: string): void

removeServer

  • removeServer(self: MonitorWatcherModule, agent: MonitorAgent, msg: any, cb: MonitorCallback): void
  • removeServer(slist: ServerInfo[], id: string): void

removeServers

replaceServer

  • replaceServer(self: MonitorWatcherModule, agent: MonitorAgent, msg: any, cb: MonitorCallback): void
  • replaceServer(slist: ServerInfo[], serverInfo: ServerInfo): void

replaceServers

reset

  • reset(info: any): void

response

restart

  • restart(app: Application, agent: MasterAgent, msg: any, cb: MasterCallback): void

restoreChannel

rpcInvoke

  • rpcInvoke(app: Application, sid: FRONTENDID, namespace: string, service: string, method: string, args: any, cb: Function): void

run

  • run(app: Application, server: ServerInfo, cb?: function): void
  • Run server

    Parameters

    • app: Application

      current application context

    • server: ServerInfo
    • Optional cb: function
        • (err?: string | number): void
        • Parameters

          • Optional err: string | number

          Returns void

    Returns void

runServer

  • runServer(app: Application, server: ServerInfo, cb: function): void
  • Parameters

    • app: Application
    • server: ServerInfo
    • cb: function
        • (err?: Error, result?: any): void
        • Parameters

          • Optional err: Error
          • Optional result: any

          Returns void

    Returns void

runServers

scheduleCrons

  • scheduleCrons(server: Server, crons: Cron[]): void

send

sendCronInfo

  • sendCronInfo(cron: any, agent: MasterAgent, msg: any, info: any, cb: Function): void
  • Parameters

    • cron: any
    • agent: MasterAgent
    • msg: any
    • info: any
    • cb: Function

    Returns void

sendMessageByGroup

  • sendMessageByGroup(channelService: ChannelService, route: string, msg: any, groups: object, opts: any, cb: Function): void
  • push message by group

    Parameters

    • channelService: ChannelService
    • route: string

      route route message

    • msg: any

      message that would be sent to client

    • groups: object

      grouped uids, , key: sid, value: [uid]

      • [sid: string]: UID[]
    • opts: any

      push options

    • cb: Function

      cb(err)

    Returns void

setupEnv

setupHeartbeat

size

  • size(obj: any): number
  • Get the count of elements of object

    Parameters

    • obj: any

    Returns number

spawnProcess

  • spawnProcess(command: string, host: string, options: string[], cb?: function): void
  • Fork child process to run command.

    Parameters

    • command: string
    • host: string
    • options: string[]
    • Optional cb: function
        • (result: string | number): void
        • Parameters

          • result: string | number

          Returns void

    Returns void

sshrun

  • sshrun(cmd: string, host: string, cb?: function): void
  • Use ssh to run command.

    Parameters

    • cmd: string

      command that would be executed in the remote server

    • host: string

      remote server host

    • Optional cb: function

      callback function

        • (err?: string | number): void
        • Parameters

          • Optional err: string | number

          Returns void

    Returns void

startByType

  • Start servers by type.

    Parameters

    • app: Application
    • cb: function
        • (err?: Error): void
        • Parameters

          • Optional err: Error

          Returns void

    Returns void

startCluster

  • startCluster(app: Application, msg: any, cb: MasterCallback): void

startModule

  • startModule(err: Error, modules: IModule[], index: number, cb: function): void
  • Parameters

    • err: Error
    • modules: IModule[]
    • index: number
    • cb: function
        • (err?: Error): void
        • Parameters

          • Optional err: Error

          Returns void

    Returns void

startModules

  • startModules(modules: IModule[], cb: function): void
  • Parameters

    • modules: IModule[]
    • cb: function
        • (err?: Error): void
        • Parameters

          • Optional err: Error

          Returns void

    Returns void

startOver

startServer

  • startServer(app: Application, msg: any, cb: function): void
  • Parameters

    • app: Application
    • msg: any
    • cb: function
        • (err?: Error | string, result?: any): void
        • Parameters

          • Optional err: Error | string
          • Optional result: any

          Returns void

    Returns void

startsWith

  • startsWith(str: string, prefix: string): boolean
  • Check a string whether starts with another string

    Parameters

    • str: string
    • prefix: string

    Returns boolean

stop

  • stop(app: Application, agent: MasterAgent, msg: any, cb: MasterCallback): void

stopComps

  • stopComps(comps: IComponent[], index: number, force: boolean, cb: function): void
  • Stop components.

    Parameters

    • comps: IComponent[]

      component list

    • index: number

      current component index

    • force: boolean

      whether stop component immediately

    • cb: function
        • (): void
        • Returns void

    Returns void

subscribe

  • subscribe(module: MasterWatcherModule, agent: MasterAgent, msg: any, cb: MasterCallback): void

subscribeRequest

  • subscribeRequest(self: MonitorWatcherModule, agent: MonitorAgent, id: string, cb: MonitorCallback): void

transaction

unicodeToUtf8

  • unicodeToUtf8(str: string): string
  • transform unicode to utf8

    Parameters

    • str: string

    Returns string

unsubscribe

  • unsubscribe(module: MasterWatcherModule, agent: MasterAgent, msg: any, cb: MasterCallback): void

watchHandlers

Object literals

ClusterInfo

ClusterInfo: object

clusterCount

clusterCount: number = 0

host

host: number = 0

port

port: number = 0

CronInfo

CronInfo: object

action

action: number = 0

id

id: number = 0

time

time: number = 0

RemoveCron

RemoveCron: object

id

id: number = 0

ServerInfo

ServerInfo: object

ServerInfo

Optional args

args: string | string[]

Optional auto-restart

auto-restart: boolean

Optional clientHost

clientHost: string

Optional clientPort

clientPort: number

Optional clusterCount

clusterCount: number

Optional cpu

cpu: number

Optional frontend

frontend: boolean

Optional handlerPaths

handlerPaths: string[]

host

host: string = 0

id

id: string = 0

Optional max-connections

max-connections: number

port

port: number = 0

Optional remoterPaths

remoterPaths: RemoteServerCode[]

Optional restart-force

restart-force: boolean

serverType

serverType: string = 0

masterMethods

masterMethods: object

query

query: query = query

record

record: record = record

subscribe

subscribe: subscribe = subscribe

unsubscribe

unsubscribe: unsubscribe = unsubscribe

monitorMethods

monitorMethods: object

addServer

addServer: addServer = addServer

removeServer

removeServer: removeServer = removeServer

replaceServer

replaceServer: replaceServer = replaceServer

startOver

startOver: startOver = startOver

types

types: object

0

0: string = "reserved"

1

1: string = "connect"

10

10: string = "unsubscribe"

11

11: string = "unsuback"

12

12: string = "pingreq"

13

13: string = "pingresp"

14

14: string = "disconnect"

15

15: string = "reserved"

2

2: string = "connack"

3

3: string = "publish"

4

4: string = "puback"

5

5: string = "pubrec"

6

6: string = "pubrel"

7

7: string = "pubcomp"

8

8: string = "subscribe"

9

9: string = "suback"