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

Unified Diff: samples/actors/core/actors-term.dart

Issue 8969032: updated readme (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated README Created 9 years 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 | « samples/actors/README ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/actors/core/actors-term.dart
diff --git a/samples/actors/core/actors-term.dart b/samples/actors/core/actors-term.dart
index e082de85f3eb7160afd3ceff78d9f631a65b56f8..f07ef4e6d0570948fc76f455d44b98cced390d5d 100644
--- a/samples/actors/core/actors-term.dart
+++ b/samples/actors/core/actors-term.dart
@@ -8,6 +8,14 @@ class _WindowActor extends Actor {
on["print"] = (String m) {
print("${m}");
};
+
+ /**
+ * Sends a message back using the 'reply' parameter after specified number
+ * of milliseconds specified by 'timeout' parameter.
+ */
+ on["setTimeout"] = (Reply reply, int timeout) {
+ new Timer((Timer t) {reply.respond();}, timeout, false);
+ };
}
}
@@ -16,4 +24,7 @@ class _WindowProxyImpl extends _NullWindowProxy {
_WindowProxyImpl(this._window);
void print(String m) => _window.send("print", [m]);
+
+ void setTimeout(Reply t, int timeout) =>
+ _window.send("setTimeout", [t, timeout]);
}
« no previous file with comments | « samples/actors/README ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698