W3C home > Mailing lists > Public > public-html-comments@w3.org > April 2008

Re: [whatwg] postMessage() issues

From: Peter Kasting <pkasting@google.com>
Date: Wed, 16 Apr 2008 16:17:42 -0700
Message-ID: <d62cf1d10804161617k2c9c2da7i3d22520c82667c4b@mail.gmail.com>
To: "Jonas Sicking" <jonas@sicking.cc>
Cc: "Maciej Stachowiak" <mjs@apple.com>, whatwg@whatwg.org, "IE8 Core AJAX SWAT Team" <ieajax@microsoft.com>, "Ian Hickson" <ian@hixie.ch>, "Sunava Dutta" <sunavad@windows.microsoft.com>, "public-html-comments@w3.org" <public-html-comments@w3.org>
On Wed, Apr 16, 2008 at 3:17 PM, Jonas Sicking <jonas@sicking.cc> wrote:

> - Processing a reply synchronously is awkward in any case, since you need
> > a callback.
> >
>
> I'm not sure I follow this argument, I actually come to the opposite
> conclusion.
>
> Say that a page is communicating with multiple iframes using
> postMessage, and expect replies from all of them.


I think the argument assumed you were communicating with a single frame in
the common case, in which case the current API is more awkward than one in
which the postMessage() call itself returns the response, requiring no
listener at all.

- This is different from event dispatch because replies are expected to be
> > common; two way communication channels like postMessage make more sense as
> > asynchronous, while event dispatch is typically one-way.
> >
>
> Why does two-way communication make more sense asynchronous? See above for
> why responses are more complicated with async communication.


>From one of Aaron Boodman's mails: if you're doing a postMessage() response
back to a frame when it calls you, then the original frame will get called
with your response before its original postMessage() actually returns.  This
nesting feels bizarre compared to a more linear "I send a message, then I
get a response" flow.

PK
Received on Thursday, 17 April 2008 03:10:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 1 June 2011 00:13:58 GMT