Starts listening for sync channel requests in a Web Worker. Waits for a SharedArrayBuffer from the main thread and begins processing requests.
A VoidIOResult indicating success or failure.
VoidIOResult
1.1.0
// In worker.jsimport { SyncChannel } from 'happy-opfs';const result = SyncChannel.listen();if (result.isErr()) { console.error('Failed to start listening:', result.unwrapErr());} Copy
// In worker.jsimport { SyncChannel } from 'happy-opfs';const result = SyncChannel.listen();if (result.isErr()) { console.error('Failed to start listening:', result.unwrapErr());}
Starts listening for sync channel requests in a Web Worker. Waits for a SharedArrayBuffer from the main thread and begins processing requests.