API Docs for:
Show:

Guest Class

Extends events.EventEmitter
Module: easy-signaling

A guest which might join a Room.

It will join the room once the client sends 'join' and and leave once it emits the 'left' event.

Constructor

Guest

(
  • conn
  • room_fun
)

Parameters:

  • conn Channel

    The connection to the guest

  • room_fun Function

    Function which will be called upon joining and which should return the Room to join

Item Index

Properties

Methods

closing

() private

The connection to the guest is closing

error

(
  • The
)
private

The guest encountered an error

Parameters:

  • The Error

    error which was encountered

receive

(
  • data
)
private

The guest receives data

Parameters:

  • data Object

    The incoming message

send

(
  • data
)
private

The guest sends data

Parameters:

  • data Object

    The outgoing message

Properties

id

String

The unique identifier of the guest

status

Object

The status object of the guest. Will only be available after joining.

Events

joined

(
  • room
)

Guest joined a room

Parameters:

  • room Room

    The joined room

left

(
  • room
)

Guest left the room

Parameters:

  • room Room

    The joined room

status_changed

(
  • status
)

The status of the guest changed

Parameters:

  • status Object

    The new status