Re: Why unhandled System Messages wait in queue

On Tuesday, 2 April 2013 at 16:30, Mounir Lamouri wrote:

> On 25/03/13 14:32, Janusz Majnert wrote:
> > Hi all,
> > I have a question regarding the System Messages. Why should unhandled
> > messages wait in queue?
> 
> 
> 
> The main use case of System Messages is when you want to send some kind
> of message/event to an application and make sure the application
> receives it. For that, you have to make sure to start the application
> before sending the message.
> 
> You could then fire a simple DOM Event but as soon as a DOM Event is
> fired, if you didn't handle it, you will not be able to handle it later
> so you need to make very clear *when* the DOM Event will have to be
> fired otherwise, you will create potential race conditions.

Or the developer will simply miss the event :)  
> Unfortunately, in a page load, there is no clear and simple moment to
> fire an event. After 'load' is terribly risky because some load (like an
> external image) might dramatically delay the event.
> 
> This is why we created System Messages which are events that stay in a
> queue and will then be dispatched when needed so a page can set the
> handler at any time knowing that if the event already fired, the handler
> will be executed.

I kinda like this, because it guarantees delivery in all cases without the developer actually needing to interact with the queue or the system messages manager itself. I guess we need to clarify the abstract concept of system messages and guarantee of delivery in the runtime spec.

If you agree, I can file a bug for that.  

Received on Tuesday, 2 April 2013 15:43:31 UTC