summaryrefslogtreecommitdiff
path: root/io/actors.io
diff options
context:
space:
mode:
authorGuillermo Ramos2012-05-05 15:29:48 +0200
committerGuillermo Ramos2012-05-05 15:29:48 +0200
commit83054326eb51ea73a8078a1e7feefae88107c3db (patch)
tree83ef7d340fa261cceb4d0156bff2bb2ec32a4256 /io/actors.io
parent8ae4691e677414843cf3a84d4327d303fe3e2f41 (diff)
download7l-83054326eb51ea73a8078a1e7feefae88107c3db.tar.gz
[Io] Día 3
Diffstat (limited to 'io/actors.io')
-rw-r--r--io/actors.io16
1 files changed, 16 insertions, 0 deletions
diff --git a/io/actors.io b/io/actors.io
new file mode 100644
index 0000000..9b63944
--- /dev/null
+++ b/io/actors.io
@@ -0,0 +1,16 @@
+slower := Object clone
+faster := Object clone
+
+slower start := method(wait(2); writeln("slowly"))
+faster start := method(wait(1); writeln("quickly"))
+
+slower @@start
+faster @@start
+wait(3)
+
+
+futureResult := URL with("http://google.es") @fetch
+writeln("Do something immediately while fetch goes in bg...")
+writeln("This will block until the result is available.")
+
+writeln("Fetched ", futureResult size, " bytes")