Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Context

Container for an application session. The Context contains all application state for a session of your application. This includes Actors, Users, Assets, and other state.

Hierarchy

  • Context

Implements

Index

Constructors

constructor

Events

onStarted

  • onStarted(handler: function): this
  • The onStarted event is raised after the Context is fully initialized and ready for your application logic to start executing.

    Parameters

    • handler: function
        • (): void
        • Returns void

    Returns this

onStopped

  • onStopped(handler: function): this
  • The onStopped event is raised before the Context starts shutting down, which happens after the last user disconnects.

    Parameters

    • handler: function
        • (): void
        • Returns void

    Returns this

onUserJoined

  • onUserJoined(handler: function): this
  • The onUserJoined event is raised after a new user has joined the Context.

    Parameters

    • handler: function
        • (user: User): void
        • Parameters

          Returns void

    Returns this

onUserLeft

  • onUserLeft(handler: function): this
  • The 'onUserLeft event is raised when the given user has left the Context. After the last user leaves, the Context will be shutdown (and a 'stopped' event will soon follow).

    Parameters

    • handler: function
        • (user: User): void
        • Parameters

          Returns void

    Returns this

Accessors

actors

assets

conn

logger

rootActors

  • get rootActors(): Actor[]

sessionId

  • get sessionId(): string

storage

telemetry

users

  • get users(): User[]

Methods

actor

  • actor(actorId: string): Actor

quit

  • quit(): void

user

  • user(userId: string): User