@dxos/client
    Preparing search index...

    Class TestWorkerFactory

    In-thread worker for testing purposes. Creates a WorkerRuntime in the same thread using MessageChannel for communication.

    Hierarchy

    • Resource
      • TestWorkerFactory
    Index

    Constructors

    Accessors

    • get _ctx(): Context

      Returns Context

    • get _lifecycleState(): LifecycleState

      Returns LifecycleState

    • get isOpen(): boolean

      Returns boolean

    Methods

    • Error handler for errors that are caught by the context. By default, errors are bubbled up to the parent context which is passed to the open method.

      Parameters

      • err: Error

      Returns Promise<void>

    • To be overridden by subclasses.

      Parameters

      • _ctx: Context

      Returns Promise<void>

    • To be overridden by subclasses.

      Parameters

      • _ctx: Context

      Returns Promise<void>

    • Closes the resource. If the resource is already closed, it does nothing.

      Parameters

      • Optionalctx: Context

      Returns Promise<TestWorkerFactory>

    • Opens the resource. If the resource is already open, it does nothing. If the resource is in an error state, it throws an error. If the resource is closed, it waits for it to close and then opens it.

      Parameters

      • Optionalctx: Context

        Context to use for opening the resource. This context will receive errors that are not handled in _catch.

      Returns Promise<TestWorkerFactory>

    • Waits until the resource is open.

      Returns Promise<void>