Skip to content

Commit

Permalink
Meta: Add "readwrite-unsafe" example to MultipleReadersWriters proposal
Browse files Browse the repository at this point in the history
Updates explainer introduction so that "readwrite-unsafe" is included in
the example.

Co-authored-by: Nathan Memmott <memmott@chromium.org>
  • Loading branch information
nathanmemmott and Nathan Memmott authored Nov 22, 2023
1 parent dd99f3a commit bd6ef5a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions proposals/MultipleReadersWriters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
```

Expand Down

0 comments on commit bd6ef5a

Please sign in to comment.