Sha256: 5a5cab9cd4ded750f25cd960918ba0558a5ae00f69789298645a953f1ee79e81
Contents?: true
Size: 953 Bytes
Versions: 1
Compression:
Stored size: 953 Bytes
Contents
# Promising Future A glimpse of a promising future in which ruby supports delayed execution ## Overview require 'promise' require 'future' # can just require future if using both x = promise { 1 + 2 } y = future { sleep 10; 5 + 5 } puts x # => 3 # ... do work for 5 seconds puts y # => 10, after blocking 5 seconds Promises and futures both transparantly delay the execution of a block. Futures run the evaluation of the block optimistically in another thread. Note that this is pretty useless in irb, which will evaluate everything as part of its read-eval-print loop. ## Classes * {Promise} * {Future} ## Source The source is available at <http://github.com/bhuga/promising-future> ## Author Ben Lavender (http://github.com/bhuga) ## Unlicense Promising Future is free and unencumbered public domain software. For more information, see <http://unlicense.org/> or the accompanying UNLICENSE file.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
promise-0.1.0 | README |