Skip to content

v4.1.0

Latest
Compare
Choose a tag to compare
@dumbmatter dumbmatter released this 09 Oct 18:34
· 4 commits to master since this release

Added support for transferable objects in messages and responses from both the host and worker. Example:

const buffer = new ArrayBuffer(1);
promiseWorker.postMessage(buffer, undefined, [buffer]);

promiseWorker.register(async (buffer) => {
  const processed = await processBuffer(buffer);

  return {
    message: processed,
    _PWB_TRANSFER: [processed.someTransferableProprty],
  };
});