blob: 9d9d1c1a75f58f90ba0d5ffe3c5e539eda892b87 [file] [log] [blame]
/*
* Copyright (c) 2016, the Dart project authors. Please see the AUTHORS
* file for details. All rights reserved. Use of this source code is governed
* by a BSD-style license that can be found in the LICENSE file.
*/
/**
* Passive isolate, waits for requests
* @author a.semenov@unipro.ru
*/
import "dart:isolate";
main(List<String> args, List message) {
dynamic i = 1;
SendPort sendPort = message[1];
ReceivePort receivePort = new ReceivePort();
receivePort.listen(
(data) {
sendPort.send(data);
// An error that should stop the isolate
sendPort.send(", " + i);
sendPort.send("hello");
}
);
message[0].send(receivePort.sendPort);
}