Permalink
Browse files

Rubygem release

  • Loading branch information...
seanlilmateus committed Mar 30, 2013
1 parent be3d890 commit 19aa3d3e1416573c3b1efad0571dbe5ca68962c8
Showing with 15 additions and 10 deletions.
  1. +15 −9 README.md
  2. BIN futuristic-0.4.3.gem
  3. +0 −1 futuristic.gemspec
View
@@ -1,32 +1,37 @@
#Futures and Promises
-This is a rubymotion implementation of the future, promise pattern on top of Rubymotion/MacRuby Dispatch Module.
+This is a rubymotion implementation of the Futures and Promise pattern, on top of Grand Central [Dispatch](https://github.com/MacRuby/MacRuby/wiki/Dispatch-Module).
-Promise and Futures both transparently defer the execution of a block. Promises evaluate the given block if and when its result is first needed. Futures evaluate the given block optimistically in another [Dispatch::Queue](https://github.com/MacRuby/MacRuby/wiki/Dispatch-Module).
+##What are Future and Promises?
+> In computer science, future, promise, and delay refer to constructs used for
+> synchronizing in some concurrent programming languages. They describe an object
+> that acts as a proxy for a result that is initially unknown, usually because the
+> computation of its value is yet incomplete<[source Wikipedia](http://en.wikipedia.org/wiki/Futures_and_promises)>.
-##Future and Promose
-are objects holding a value which may become available at some point. This value is usually the result of some other computation. Since this computation may fail with an exception, the Future may also hold an exception in case the computation throws one.
+##Futures and Promises
+are objects holding a value which may become available at some point. This value is usually the result of some other computation. Since this computation may fail with an exception, the Future/Promise may also hold an exception in case the computation throws one.
#Usage:
-
-on your Gem file
+in your Gem file
```ruby
gem 'futuristic', :git => 'git://github.com/seanlilmateus/futuristic.git'
```
-###example using Promise
+###how to use Promises
```ruby
def fibonacci(n)
return n if n < 2
fib1 = Dispatch::Promise.new { fibonacci(n-1) }
fib2 = Dispatch::Promise.new { fibonacci(n-2) }
fib1 + fib2
end
+
+p fibonacci(10) # => 55
```
-###example using Futures
+###how to use Futures
```ruby
# computation is started
@@ -87,4 +92,5 @@ p computation.value # => 42
#Todo
- Parallel Enumerable
- Actor models
-- documentation and examples
+- documentation and examples
+
View
Binary file not shown.
View
@@ -13,7 +13,6 @@ Gem::Specification.new do |gem|
gem.email = 'seanlilmateus@yahoo.de'
gem.files = ["lib/futuristic.rb"]
gem.homepage = 'http://github.com/seanlilmateus/futuristic'
-
gem.files = `git ls-files`.split($/)
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})

0 comments on commit 19aa3d3

Please sign in to comment.