From bd6ef5a2cb6462d7810ab0f4b382edbb2d6eda45 Mon Sep 17 00:00:00 2001 From: nathanmemmott <123413584+nathanmemmott@users.noreply.github.com> Date: Tue, 21 Nov 2023 17:21:47 -0800 Subject: [PATCH] Meta: Add "readwrite-unsafe" example to MultipleReadersWriters proposal Updates explainer introduction so that "readwrite-unsafe" is included in the example. Co-authored-by: Nathan Memmott --- proposals/MultipleReadersWriters.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/proposals/MultipleReadersWriters.md b/proposals/MultipleReadersWriters.md index b89113b..9658f2e 100644 --- a/proposals/MultipleReadersWriters.md +++ b/proposals/MultipleReadersWriters.md @@ -13,8 +13,12 @@ Currently, only one instance of [FileSystemSyncAccessHandle](https://fs.spec.whatwg.org/#api-filesystemsyncaccesshandle) may be open at a time, given a [file system entry](https://fs.spec.whatwg.org/#entry). This explainer proposes a new locking scheme and API changes to support multiple readers and writers for `FileSystemSyncAccessHandle` and an exclusive writer for `FileSystemWritableFileStream`. +Introducing new locking modes for [FileSystemSyncAccessHandle](https://fs.spec.whatwg.org/#api-filesystemsyncaccesshandle) and [FileSystemWritableFileStream](https://fs.spec.whatwg.org/#api-filesystemwritablefilestream) allows opening either multiple readers/writers or an exclusive writer to a file entry, depending on the application's use case. + ``` handle.createSyncAccessHandle({ mode: 'read-only' }); +handle.createSyncAccessHandle({ mode: 'readwrite-unsafe' }); + handle.createWritable({ mode: 'exclusive' }); ```