Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SharedMemoryFeature

Hierarchy

Index

Constructors

Properties

#private: any
makeMemorySyncRequest: any
messagePort?: MessagePort
onMessage: any
processMemorySyncRequest: any
worker: WorkerLike

Methods

  • get(key: string | symbol): unknown
  • Returns a value or a function that is a proxy for a method or property being accessed on the underlying worker.

    remarks

    The base WorkerFeature class returns undefined, but derived implementations should override WorkerFeature.get(...) in order to return appropriate proxies.

    virtual

    Parameters

    • key: string | symbol

      The key being acccessed.

    Returns unknown

    A value or a function that is a proxy for key. Returns undefined if no proxy can to satisfy key.

  • sync(ptr: number): Promise<Memory>
  • Parameters

    • ptr: number

    Returns Promise<Memory>

  • tryGet<T>(target: T): InstanceType<T>
  • Retrieves a worker feature for the current worker thread.

    Type Parameters

    Parameters

    Returns InstanceType<T>

    The WorkerFeature instance for target, or undefined if the current worker thread has not been decorated with the feature described by target.

Generated using TypeDoc