blob: 3886b0d3e1de8ac02a2d9a64680ce1917924e194 [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);
}