diff options
Diffstat (limited to 'io/actors.io')
-rw-r--r-- | io/actors.io | 16 |
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") |