Skip to main content

SemaphoreResource <T>

A decorator for a resource that adds concurrency control functionality through a semaphore.

Hierarchy

Index

Constructors

constructor

  • Type parameters

    Parameters

    • resource: T
    • semaphore: default

    Returns SemaphoreResource<T>

Accessors

isAsync

  • get isAsync(): boolean
  • Whether this Resource is loaded asynchronously


    Returns boolean

name

  • get name(): string
  • The name of the referenced file


    Returns string

progress

  • get progress(): undefined | ProgressTracker
  • set progress(value: undefined | ProgressTracker): void
  • Optional progress tracker to monitor progress


    Returns undefined | ProgressTracker

  • Optional progress tracker to monitor progress


    Parameters

    • value: undefined | ProgressTracker

    Returns void

Methods

resolve

  • resolve(): Promise<File>
  • Resolves the file contents


    Returns Promise<File>

    The resolved file.

setPlayground

  • @inheritDoc

    Parameters

    Returns Promise<void>

staticcreate

  • Creates a new Resource based on the given file reference


    Parameters

    Returns Resource

    A new Resource instance