| Index: samples/proxy/promise.dart
|
| diff --git a/samples/proxy/promise.dart b/samples/proxy/promise.dart
|
| index 492339d21c6832d6b5318fb14faecfc866ead123..f3845d64f4cafec9bd724e16915800b9f9ed2246 100644
|
| --- a/samples/proxy/promise.dart
|
| +++ b/samples/proxy/promise.dart
|
| @@ -171,8 +171,9 @@ class Dispatcher<T> {
|
|
|
| class PromiseProxy<T> extends PromiseImpl<T> {
|
| PromiseProxy(Promise<SendPort> sendCompleter) {
|
| - ReceivePort completer = new ReceivePort.singleShot();
|
| - completer.receive((var msg, SendPort _) {
|
| + ReceivePort completer = new ReceivePort();
|
| + completer.then((var msg) {
|
| + completer.close();
|
| complete(msg[0]);
|
| });
|
| sendCompleter.addCompleteHandler((SendPort port) {
|
| @@ -527,10 +528,11 @@ class ProxyBase extends PromiseImpl<bool> {
|
| // This port will receive a SendPort that can be used to
|
| // signal completion of this promise to the corresponding
|
| // promise that the other end has created.
|
| - ReceivePort receiveCompleter = new ReceivePort.singleShot();
|
| + ReceivePort receiveCompleter = new ReceivePort();
|
| marshalled[i] = receiveCompleter.toSendPort();
|
| Promise<SendPort> completer = new Promise<SendPort>();
|
| receiveCompleter.receive((var msg, SendPort replyPort) {
|
| + port.close();
|
| completer.complete(msg[0]);
|
| });
|
| entry.addCompleteHandler((value) {
|
|
|