Changes between Version 1 and Version 2 of Ticket #3499


Ignore:
Timestamp:
01/11/2016 02:17:39 PM (4 years ago)
Author:
trev
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3499 – Description

    v1 v2  
    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 to return `true` if it wants to use the callback asynchronously, otherwise it will expire when the function returns. 
     15Message 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.