Skip to main content

TActorPool <T>

Index

Constructors

Properties

Methods

Constructors

constructor

  • new TActorPool<T>(actor: () => T, startingInstances: number): default<T>

Properties

publicdead

dead: boolean = false

Methods

publicacquire

  • acquire(): undefined | T
  • Acquires an actor from the pool, and initializes a new one if necessary


    Returns undefined | T

publicdestroy

  • destroy(): void
  • Runs destroy all actors remaining in the pool. This will not destroy actors that have been acquired.

    Once this method is called, the pool is no longer usable.


    Returns void

publicrelease

  • release(actor: T): void
  • Releases actor back to the pool, resets and removes it from the world


    Parameters

    • actor: T

    Returns void