Re: What changes to Web Messaging spec are proposed? [Was: Re: Using ArrayBuffer as payload for binary data to/from Web Workers]

On Tue, Jun 21, 2011 at 12:39 AM, Ian Hickson <ian@hixie.ch> wrote:
> On Mon, 20 Jun 2011, Jonas Sicking wrote:
>>
>> If data appears both in the .ports array and the .data property, then
>> people will be tempted to create protocols which only work if the array
>> buffer is transferred, i.e. if the receiver only looks in .ports. I.e.
>> people will likely end up with equally ugly solutions like:
>>
>> postMessage('vend-reply', [createClone(arraybuffer)]);
>
> Yeah, that's a very good point.
>
> It really seems like part of the problem here is that ports and
> arrayBuffers are quite different (in that one will always want to be
> transferred, but for the other you might want to sometimes transfer and
> sometimes not).

I don't think we should worry too much about suboptimal syntax when
transferring ports. We can always add more syntax sugar later if
people think it's annoying. Better keep the initial version simple
than to try to guess which use cases will be the most common ones.

/ Jonas

Received on Tuesday, 21 June 2011 07:54:58 UTC