Skip to main content

Class: SocketEventHandler

Defined in: socket/index.ts:19

Class to handle Socket Events such as connecting and disconnecting from rooms.

Extended by

Constructors

Constructor

new SocketEventHandler(room, eventName, source, payload): SocketEventHandler

Defined in: socket/index.ts:41

Parameters

room

Room

The Room where the event is happening

eventName

string

The name of the event

source

User

The User associated with the event

payload

IKeyValue

The input values of the event

Returns

SocketEventHandler

Properties

eventName

protected eventName: string

Defined in: socket/index.ts:21

The event name of a socket event


input

protected input: IKeyValue

Defined in: socket/index.ts:27

The input of the socket event


output

protected output: SocketIOContextOutput

Defined in: socket/index.ts:24

The output of the socket event


room

protected room: Room

Defined in: socket/index.ts:30

The room where the event is occurring


source

protected source: User

Defined in: socket/index.ts:33

The user associated with the event

Methods

passthru()

protected passthru(): Promise<void>

Defined in: socket/index.ts:52

Event to Trigger a sendToRooms event.

Returns

Promise<void>


process()

protected process(): Promise<void>

Defined in: socket/index.ts:67

A method to process data/information. Should be overridden in subclasses.

Returns

Promise<void>


result()

result(): Promise<SocketIOContextOutput>

Defined in: socket/index.ts:72

The output produced from this.process

Returns

Promise<SocketIOContextOutput>