Skip to main content

Class: WebSocketPlugin

A plugin for handling WebSockets.

Extends​

Constructors​

Constructor​

new WebSocketPlugin(logger, injector): WebSocketPlugin

Parameters​

logger​

Logger

injector​

Injector

Returns​

WebSocketPlugin

Overrides​

Plugin.constructor

Properties​

options​

protected options: WebSocketPluginOptions

Overrides​

Plugin.options


state​

protected state: PluginLifecycle

Inherited from​

Plugin.state


stateError?​

protected optional stateError?: Error

Inherited from​

Plugin.stateError


dependencies​

readonly static dependencies: object[]

optional​

optional: boolean = true

plugin​

plugin: typeof HttpPlugin = HttpPlugin

Overrides​

Plugin.dependencies

Methods​

getState()​

getState(): PluginLifecycle

Retrieves the current lifecycle state of the plugin.

Returns​

PluginLifecycle

The current lifecycle state of the plugin.

Inherited from​

Plugin.getState


getStateError()​

getStateError(): Error | undefined

Retrieves the error state of the plugin, if any.

Returns​

Error | undefined

The error that caused the plugin to enter the error state, or undefined if no error occurred.

Inherited from​

Plugin.getStateError


onRegister()​

onRegister(context, options?): Promise<void>

Lifecycle method called when the plugin is registered.

Parameters​

context​

AxiSparkContext

The AxiSparkContext to be passed to the plugin during registration.

options?​

WebSocketPluginOptions

The options for the plugin.

Returns​

Promise<void>

Overrides​

Plugin.onRegister


onStart()​

onStart(): Promise<void>

Lifecycle method called when the plugin is started.

Returns​

Promise<void>

Overrides​

Plugin.onStart


onStop()​

onStop(): Promise<void>

Lifecycle method called when the plugin is stopped.

Returns​

Promise<void>

Overrides​

Plugin.onStop


setState()​

setState(state): void

Sets the lifecycle state of the plugin.

Parameters​

state​

PluginLifecycle

The new lifecycle state of the plugin.

Returns​

void

Inherited from​

Plugin.setState


setStateError()​

setStateError(error): void

Sets the error state of the plugin.

Parameters​

error​

Error

The error that caused the plugin to enter the error state.

Returns​

void

Inherited from​

Plugin.setStateError