W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2013

Re: [whatwg] onclose events for MessagePort

From: Gene Lian <clian@mozilla.com>
Date: Wed, 2 Oct 2013 05:02:38 -0700 (PDT)
To: whatwg <whatwg@lists.whatwg.org>
Message-ID: <1410130868.1598018.1380715358709.JavaMail.zimbra@mozilla.com>
Cc: olli@pettay.fi, squibblyflabbetydoo@gmail.com, Andrew Wilson <atwilson@google.com>, Ehsan Akhgari <ehsan@mozilla.com>
Hi guys,

Not really be able to follow all the details and technical terms. However, I'd also highly agree it's worth adding an onclose event to imply the aliveness of the owner (on the other end).

We can imagine in the future MessagePort will be a very generic structure utilised in lots of messaging purposes. If an API that wants to do the so-called *connection-oriented* messaging, the port had better need a way to know when the connection is being unexpectedly disconnected. If both of the owners are still alive, they can naturally use postMessage/onmessage to explicitly do the disconnection with each other.

However, what's happening if one of the owner has gone away without saying goodbye? For example, window can be closed when its owning process gets killed or crashed. Under the circumstances, the central/parent process is the only role to be aware of that and responsible for delivering the onclose event to the other end. From the point of view of implementation, it's definitely doable.

IMO, adding onclose event can make the MessagePort more flexible and more friendly to be applied in lots of messaging APIs. I'd vote for that.

Received on Wednesday, 2 October 2013 12:03:06 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:11 UTC