W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2008

[whatwg] reply() extension to postMessage()

From: Jeff Walden <jwalden+whatwg@MIT.EDU>
Date: Tue, 19 Feb 2008 07:50:47 -0500
Message-ID: <47BAD0A7.8020207@mit.edu>
Ian Hickson wrote:
>> ...this behavior could cause some somewhat nasty infinite recursion. So 
>> what if we made reply() asynchronous so that the the reply message event 
>> doesn't need to be dispatched on the original message posting document 
>> until after the original postMessage from the sender is finished 
>> processing?
> 
> This problem exists today with postMessage() too. Do people think we 
> should go fully asynchronous?

Frankly, I'm not all that worried about someone accidentally triggering infinite recursion; it's easy enough to detect (by the error that's hit?  I don't know IE/Opera behaviors here), and setTimeout is easy enough to use.

I think I favor sync postMessage over async because async capabilities are a strict subset of sync capabilities.  You can always use setTimeout with the sync model to get async behavior; if the model is async you can't replicate sync behavior.

Jeff
Received on Tuesday, 19 February 2008 04:50:47 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:39 UTC