W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2013

Promises in E (was Re: A Challenge Problem for Promise Designers)

From: Bill Frantz <frantz@pwpconsult.com>
Date: Fri, 26 Apr 2013 06:03:57 -0700
To: Andreas Rossberg <rossberg@google.com>
cc: David Bruant <bruant.d@gmail.com>, "Mark S. Miller" <erights@google.com>, public-script-coord@w3.org, Mark Miller <erights@gmail.com>, Dean Tribble <tribble@e-dean.com>, es-discuss <es-discuss@mozilla.org>
Message-ID: <r422Ps-1075i-B784223D98614ADC9D729FF9CD17415E@Williams-MacBook-Pro.local>
Let me take a crack at describing E's support for promises.

E has two modes for sending a message to an object. There is the 
immediate send and the eventual send. If the Object is an 
unresolved promise the immediate send will trap. (A promise can 
be forced to resolve using the "when" construct.)

If the program uses eventual sends, then unresolved promises act 
like any other value. This allows operations such as:

Object A on machine 1
Object B on machine 2

A sends to B getting back object C also hosted on machine 2
A sends to C getting back a final result.

The way this is implemented is that when A sends to B, a promise 
for the result C is constructed. When A sends to C, that promise 
is used for the send and a promise for the final result is 
constructed. The message to C is sent without waiting for the 
response from the message to B, eliminating one round trip 
communication delay.

If A needs to use the final result in an immediate operation, it 
will wait for the final result promise to be resolved using the 
"when" construct.

Cheers - Bill

-----------------------------------------------------------------------
Bill Frantz        | I like the farmers' market   | Periwinkle
(408)356-8506      | because I can get fruits and | 16345 
Englewood Ave
www.pwpconsult.com | vegetables without stickers. | Los Gatos, 
CA 95032
Received on Saturday, 27 April 2013 17:52:52 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:49 UTC