ava icon indicating copy to clipboard operation
ava copied to clipboard

Enable value transfers in shared worker messages

Open novemberborn opened this issue 4 years ago • 2 comments

From #2705, when publishing shared worker messages, or replying to an individual message, we should enable values to be transferred.

I don't think a second "transfer list" API is a good fit for the shared worker API. Perhaps we could add a chaining API like .transferring(buffer1, messagePort2).publish({buffer1, messagePort2}) and .transferring(buffer1, messagePort2).reply({buffer1, messagePort2}).

Values can only be transferred once. This also means we can't add this to the .broadcast() method.

See:

https://github.com/avajs/ava/blob/0e5cc7dc2b1512d0abe9bfba57b26888eedea0cf/plugin.d.ts#L35

https://github.com/avajs/ava/blob/0e5cc7dc2b1512d0abe9bfba57b26888eedea0cf/plugin.d.ts#L41

novemberborn avatar Apr 06 '21 15:04 novemberborn

@dnlup let me know if you're still interested in working on this 😄

novemberborn avatar Apr 06 '21 15:04 novemberborn

It is a nice challenge, but I am a little swamped atm. I hope to be able to get at it soon.

dnlup avatar Apr 07 '21 07:04 dnlup