Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Unified Diff: sdk/lib/isolate/isolate.dart

Issue 1181043003: be more explicit about when and how to register for listeners with isolates (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/isolate/isolate.dart
diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart
index 8372eafbc169c2562f212ff442b810ec352a6a54..9b488c21bb243150f8e52c68dd02c3034e105f67 100644
--- a/sdk/lib/isolate/isolate.dart
+++ b/sdk/lib/isolate/isolate.dart
@@ -276,6 +276,10 @@ class Isolate {
* If `response` cannot be sent to the isolate, then the request is ignored.
* It is recommended to only use simple values that can be sent to all
* isolates, like `null`, booleans, numbers or strings.
+ *
+ * Since isolates run concurrently, it's possible for it to exit before the
+ * exit listener is established. To avoid this, start the isolate paused,
+ * add the listener, then resume it.
*/
/* TODO(lrn): Can we do better? Can the system recognize this message and
* send a reply if the receiving isolate is dead?
@@ -364,6 +368,10 @@ class Isolate {
*
* Listening using the same port more than once does nothing. It will only
* get each error once.
+ *
+ * Since isolates run concurrently, it's possible for it to exit before the
nweiz 2015/06/12 19:18:55 "exit" -> "emit an error"
Lasse Reichstein Nielsen 2015/06/12 19:38:16 "exit or emit an error"? It can do either or both
nweiz 2015/06/12 21:05:43 That's true, but if it exits before the listener i
+ * error listener is established. To avoid this, start the isolate paused,
+ * add the listener, then resume it.
*/
external void addErrorListener(SendPort port);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698