ReadonlyclosedThe connection to the services provider was terminated. This should fire if the services disconnect unexpectedly or during a client reset.
Register a callback to be invoked when services reconnect.
The callback should re-establish any RPC streams.
Reconnection waits for all callbacks to complete before emitting reconnected.
ReadonlyreconnectedThe underlying service connection was re-established. Fires after all reconnection callbacks have completed.
Protected_ctxProtected_lifecycleProtected_catchError 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.
To be overridden by subclasses.
To be overridden by subclasses.
await using resource = new Resource();
await resource.open();
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using
Closes the resource. If the resource is already closed, it does nothing.
Optionalctx: ContextOpens 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.
Optionalctx: ContextContext to use for opening the resource. This context will receive errors that are not handled in _catch.
Calls the provided function, opening and closing the resource.
NOTE: Consider using using instead.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using
Waits until the resource is open.
Runs services in a dedicated worker, exposed to other tabs. Leader election is used to ensure only a single worker is running.