futuroscope 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -4
- data/lib/futuroscope/future.rb +1 -0
- data/lib/futuroscope/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c5bfc96787c383b381813d3545f8376c4b8be62
|
4
|
+
data.tar.gz: 0340a235f63a724fe4a8c99482f343511549fbf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbae70b4f11a755a907142918eef1722b0635f177f21c4e2c4221cc17436f325106d948d039f2d4d516b8b15e0b6ffa83547432b34f0bcc7ab8e14e9c4445158
|
7
|
+
data.tar.gz: 8db0c3be748aee7e2e4a79e8b40f4085748fcf6e5af95ed5f0a8d799bd60a8fe1ba4b6e9a4b6840513ae9560e0c1a80b44cefec48cf44d487d146f53e19dfb27
|
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# Futuroscope
|
2
2
|
[](http://badge.fury.io/rb/futuroscope)
|
3
3
|
[](https://travis-ci.org/codegram/futuroscope)
|
4
|
-
[](https://codeclimate.com/github/codegram/futuroscope)
|
5
5
|
[](https://coveralls.io/r/codegram/futuroscope)
|
6
|
+
[](https://gemnasium.com/codegram/futuroscope)
|
6
7
|
|
7
8
|
Futursocope is a simple library that implements futures in ruby. Futures are a
|
8
9
|
concurrency pattern meant to help you deal with concurrency in a simple way.
|
@@ -16,15 +17,17 @@ You can learn more about futures here in this excellent article from @jpignata:
|
|
16
17
|
[Concurrency Patterns in Ruby:
|
17
18
|
Futures](http://tx.pignata.com/2012/11/concurrency-patterns-in-ruby-futures.html)
|
18
19
|
|
19
|
-
In Futuroscope, futures are
|
20
|
+
In Futuroscope, futures are instantiated with a simple ruby block. The future's
|
20
21
|
execution will immediately start in a different thread and when you call a
|
21
22
|
method on in it will be forwarded to the block's return value.
|
22
23
|
|
23
24
|
If the thread didn't finish yet, it will block the program's execution until
|
24
|
-
it's finished. Otherwise, it will
|
25
|
+
it's finished. Otherwise, it will immediately return its value.
|
25
26
|
|
26
27
|
Futuroscope is tested on `MRI 1.9.3`, `MRI 2.0.0`, `Rubinius (1.9)` and `JRuby (1.9)`.
|
27
28
|
|
29
|
+
Check out [futuroscope's post on Codegram's blog](http://blog.codegram.com/2013/5/new-gem-released-futuroscope) to get started.
|
30
|
+
|
28
31
|
## Installation
|
29
32
|
|
30
33
|
Add this line to your application's Gemfile:
|
@@ -122,7 +125,7 @@ like they were a local variable, with the only outcome that they're returning a
|
|
122
125
|
value.
|
123
126
|
|
124
127
|
You have to take into account that they really run in a different thread, so
|
125
|
-
you'll be potentially accessing code in parallel that could not be
|
128
|
+
you'll be potentially accessing code in parallel that could not be thread-safe.
|
126
129
|
|
127
130
|
If you're looking for other ways to improve your code performance via
|
128
131
|
concurrency, you should probably deal directly with [Ruby's
|
@@ -163,3 +166,7 @@ future = future(pool){ :edballs }
|
|
163
166
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
164
167
|
4. Push to the branch (`git push origin my-new-feature`)
|
165
168
|
5. Create new Pull Request
|
169
|
+
|
170
|
+
|
171
|
+
[](https://bitdeli.com/free "Bitdeli Badge")
|
172
|
+
|
data/lib/futuroscope/future.rb
CHANGED
data/lib/futuroscope/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: futuroscope
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|