Reference Source
public class | source

BusNodeFeature

Extends:

NodeFeature → BusNodeFeature

Node feature: manages a bus.

Example:

	Bus engine format:
		{
			package:'default' or 'my bus engine NPM package',
			type:'Server' or 'Client',
			protocole:'http' or 'https,
			host:'...',
			port:'...',
			settings:{} // optional
		}

Constructor Summary

Public Constructor
public

constructor(arg_node: Node, arg_name: string): nothing

Create a BusNodefeature instance.

Member Summary

Public Members
public

bus: MessageBus

Feature bus instance.

public

Class type flag.

Method Summary

Public Methods
public

create_bus_engine(arg_package: string, arg_name: string, arg_settings: object): BusEngine

Create a bus engine.

public

create_message_bus(): MessageBus

Create bus from settings.

public

Get bus name.

public

load(): nothing

Load Node settings.

public

start(): nothing

Starts node bus.

public

stop(): nothing

Stops node bus.

Inherited Summary

From class NodeFeature
public

Class type flag.

public

Is ready flag.

public

Feature name.

public

Node instance.

public

Get feature name.

public abstract

load(): nothing

Load Node settings.

public abstract

start(): nothing

Starts node feature.

public abstract

stop(): nothing

Stops node feature.

Public Constructors

public constructor(arg_node: Node, arg_name: string): nothing source

Create a BusNodefeature instance.

Override:

NodeFeature#constructor

Params:

NameTypeAttributeDescription
arg_node Node

node instance.

arg_name string

feature name.

Return:

nothing

Public Members

public bus: MessageBus source

Feature bus instance.

public is_bus_node_feature: boolean source

Class type flag.

Public Methods

public create_bus_engine(arg_package: string, arg_name: string, arg_settings: object): BusEngine source

Create a bus engine.

Params:

NameTypeAttributeDescription
arg_package string

class package name.

arg_name string

bus engine name.

arg_settings object

bus engine settings.

Return:

BusEngine

Bus engine instance

public create_message_bus(): MessageBus source

Create bus from settings.

Return:

MessageBus

created bus messages.

public get_bus_unique_name(): string source

Get bus name.

Return:

string

unique bus name: node name + '_' + feature bus name

public load(): nothing source

Load Node settings.

Override:

NodeFeature#load

Return:

nothing

public start(): nothing source

Starts node bus.

Override:

NodeFeature#start

Return:

nothing

public stop(): nothing source

Stops node bus.

Override:

NodeFeature#stop

Return:

nothing