happy-opfs
    Preparing search index...

    Function disconnect

    • Disconnects the sync channel and releases the resources owned by this context.

      A worker created by connect is terminated. A caller-supplied worker, or the worker behind a buffer shared with attach, is left running so other contexts that still use that buffer keep working. After disconnecting, connect or attach can be called again — this is also the way out of a channel that got stuck (worker crashed, response never arrived).

      Calling it while not connected is a no-op.

      Returns VoidIOResult

      A VoidIOResult indicating success.

      2.3.0

      connectSyncChannel for establishing a connection

      SyncChannel.disconnect();

      // A fresh connection can be established afterwards
      await SyncChannel.connect(new URL('./worker.js', import.meta.url));