Changes between Version 2 and Version 6 of Ticket #3499


Ignore:
Timestamp:
01/12/2016 11:59:53 AM (4 years ago)
Author:
trev
Comment:

True, I forgot to remove that parameter.

Actually, there is a complication I didn't consider. When the parent is broadcasting a message, there will normally be two child processes receiving it. How is the parent going to know that it received the response if each child process is going to send one? It seems that the parent needs to wait for two responses (more precisely, nsIMessageBroadcaster.childCount) to arrive, then choose the one that isn't undefined (also warn if more than one is).

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3499

    • Property Ready set
    • Property Cc sebastian added
  • Ticket #3499 – Description

    v2 v6  
    1313* `Port.emitSync()` sends a synchronous message, response is returned from the function. 
    1414 
    15 Message handlers have three parameters: `payload` (the data sent by the sender), `sender` (a `Port` instance) and `sendResponse` (callback to be called with the response). The handler has the choice between returning `undefined` (no response), a value (actual response) or a promise (indicates an async response). We should warn if multiple handlers choose to return a value for the same message or if a handler chooses to return a promise for a sync message. 
     15Message handlers have two parameters: `payload` (the data sent by the sender) and `sender` (a `Port` instance). The handler has the choice between returning `undefined` (no response), a value (actual response) or a promise (indicates an async response). We should warn if multiple handlers choose to return a value for the same message or if a handler chooses to return a promise for a sync message.