npm i shared-array-buffer-readonly-string-array
For an example of how to create and share an array among threads, see the tests in ./src/test/index.ts
.
See ./src/index.ts
, which has Typescript types.
You can:
- Make a new shareable, readonly array by prividing an array of strings.
- Iterate over it starting at the beginning
- Transfer it to other threads via
postMessage
- Access an existing shared array with
fromWorkerThreadMessageData
You can't (currently):
- Get its length
- Access values at a particular index
- Iterate starting from different positions
- Iterate in reverse