Skip to content

Latest commit

 

History

History
126 lines (88 loc) · 4.66 KB

ABServiceController.md

File metadata and controls

126 lines (88 loc) · 4.66 KB

ABServiceController ⇐ EventEmitter

Kind: global class
Extends: EventEmitter

new ABServiceController([key])

Param Type Default Description
[key] string "ABServiceController" key to identify the contoller

controller.exit() ⇒ Promise

exit this service.

Kind: instance method of ABServiceController

controller.init() ⇒ Promise

begin this service.

Kind: instance method of ABServiceController

controller.afterShutdown(fn)

Kind: instance method of ABServiceController

Param Type
fn function

controller.afterStartup(fn)

Kind: instance method of ABServiceController

Param Type
fn function

controller.beforeShutdown(fn)

Kind: instance method of ABServiceController

Param Type
fn function

controller.beforeStartup(fn)

Kind: instance method of ABServiceController

Param Type
fn function

controller.ready()

Send a 'ready' signal on this process. Useful for service managers (like pm2) to know the process is ready.

Kind: instance method of ABServiceController

controller.requestObj(option) ⇒ ABRequestService

return a new ABRequest() object.

Kind: instance method of ABServiceController

Param Type Description
option object any initial settings for the ABRequestService obj

controller.shutdown()

the process a service should perform to gracefully shutdown.

Kind: instance method of ABServiceController

controller.startup()

the process a service should perform to startup.

Kind: instance method of ABServiceController

controller._waitForConfig() ⇒ Promise

waits until the config service has posted a '.config_ready' file

Kind: instance method of ABServiceController

controller._waitForDB() ⇒ Promise

attempts to connect to our maria DB service before continuing.

Kind: instance method of ABServiceController

controller._waitForRedis() ⇒ Promise

attempts to connect to our redis server and then resolves() once the connection is ready.

Kind: instance method of ABServiceController