Global

Methods

setupInboundTopic(container, socket, topic)

Setup an inbound topic

Parameters:
Name Type Description
container Object

The container object

socket Object

The socket the server communicates with the connected client through

topic String

The name of the topic

setupOutboundTopic(container, socket, topic)

Setup an outbound topic

Setup a websocket client to observe the <topic> named events, then publish them to the
NATS topic with the same name.

Parameters:
Name Type Description
container Object

The container object

socket Object

The socket the server communicates with the connected client through

topic String

The name of the topic

shutdown(container, next)

The shutdown function of the service adapter

This function should be registered with the shutdown phase, then npac will call when graceful shutdown happens.

Parameters:
Name Type Description
container Object

The actual state of the container this adapter is running

next function

Error-first callback function to pass the result partial container extended with the wsServer adapter.

see also: the npac.startup process description.

startup(container, next)

The startup function of the adapter

This function should be registered with the startup phase, then npac will call when the project is starting.

Parameters:
Name Type Description
container Object

The actual state of the container this adapter will be added

next function

Error-first callback function to pass the result partial container extended with the wsServer adapter.

see also: the npac.startup process description.