fibur 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +8 -0
- data/.gemtest +0 -0
- data/CHANGELOG.rdoc +6 -0
- data/Manifest.txt +6 -0
- data/README.rdoc +70 -0
- data/Rakefile +22 -0
- data/lib/fibur.rb +1 -0
- metadata +94 -0
data/.autotest
ADDED
data/.gemtest
ADDED
File without changes
|
data/CHANGELOG.rdoc
ADDED
data/Manifest.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
= fibur
|
2
|
+
|
3
|
+
* http://github.com/tenderlove/fibur
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Fibur is a gem that gives you full concurrency during your I/O calls in Ruby
|
8
|
+
1.9.
|
9
|
+
|
10
|
+
== FEATURES/PROBLEMS:
|
11
|
+
|
12
|
+
* So simple it can't fail
|
13
|
+
|
14
|
+
== SYNOPSIS:
|
15
|
+
|
16
|
+
This example shows how to wrap a method call with a Fibur.
|
17
|
+
|
18
|
+
require 'benchmark'
|
19
|
+
require 'net/http'
|
20
|
+
require 'uri'
|
21
|
+
require 'fibur' # use the Fibur gem.
|
22
|
+
|
23
|
+
def network_read(uri)
|
24
|
+
Net::HTTP.get_response uri
|
25
|
+
end
|
26
|
+
|
27
|
+
n = 50000
|
28
|
+
uri = URI('http://google.com/')
|
29
|
+
|
30
|
+
Benchmark.bm(5) do |x|
|
31
|
+
x.report('loop') { 100.times { network_read(uri) } }
|
32
|
+
x.report('fibur') {
|
33
|
+
100.times.map {
|
34
|
+
Fibur.new { network_read(uri) }
|
35
|
+
}.map(&:join)
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
== REQUIREMENTS:
|
40
|
+
|
41
|
+
* Only works on Ruby 1.9
|
42
|
+
|
43
|
+
== INSTALL:
|
44
|
+
|
45
|
+
* gem install fibur
|
46
|
+
|
47
|
+
== LICENSE:
|
48
|
+
|
49
|
+
(The MIT License)
|
50
|
+
|
51
|
+
Copyright (c) 2011 Aaron Patterson, Adequate Systems
|
52
|
+
|
53
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
54
|
+
a copy of this software and associated documentation files (the
|
55
|
+
'Software'), to deal in the Software without restriction, including
|
56
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
57
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
58
|
+
permit persons to whom the Software is furnished to do so, subject to
|
59
|
+
the following conditions:
|
60
|
+
|
61
|
+
The above copyright notice and this permission notice shall be
|
62
|
+
included in all copies or substantial portions of the Software.
|
63
|
+
|
64
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
65
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
66
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
67
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
68
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
69
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
70
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
|
6
|
+
Hoe.plugins.delete :rubyforge
|
7
|
+
Hoe.plugin :minitest
|
8
|
+
Hoe.plugin :gemspec # `gem install hoe-gemspec`
|
9
|
+
Hoe.plugin :git # `gem install hoe-git`
|
10
|
+
|
11
|
+
Hoe.spec 'fibur' do
|
12
|
+
developer('Aaron Patterson', 'aaron@tenderlovemaking.com')
|
13
|
+
self.version = '1.0.0'
|
14
|
+
self.readme_file = 'README.rdoc'
|
15
|
+
self.history_file = 'CHANGELOG.rdoc'
|
16
|
+
self.extra_rdoc_files = FileList['*.rdoc']
|
17
|
+
self.spec_extras = {
|
18
|
+
:required_ruby_version => '>= 1.9.2'
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
# vim: syntax=ruby
|
data/lib/fibur.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Fibur = Thread
|
metadata
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fibur
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Aaron Patterson
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-12-19 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: minitest
|
16
|
+
requirement: &70360662489260 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.9'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70360662489260
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: hoe
|
27
|
+
requirement: &70360662488720 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.12'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70360662488720
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rdoc
|
38
|
+
requirement: &70360662849400 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3.10'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70360662849400
|
47
|
+
description: ! 'Fibur is a gem that gives you full concurrency during your I/O calls
|
48
|
+
in Ruby
|
49
|
+
|
50
|
+
1.9.'
|
51
|
+
email:
|
52
|
+
- aaron@tenderlovemaking.com
|
53
|
+
executables: []
|
54
|
+
extensions: []
|
55
|
+
extra_rdoc_files:
|
56
|
+
- Manifest.txt
|
57
|
+
- CHANGELOG.rdoc
|
58
|
+
- README.rdoc
|
59
|
+
files:
|
60
|
+
- .autotest
|
61
|
+
- CHANGELOG.rdoc
|
62
|
+
- Manifest.txt
|
63
|
+
- README.rdoc
|
64
|
+
- Rakefile
|
65
|
+
- lib/fibur.rb
|
66
|
+
- .gemtest
|
67
|
+
homepage: http://github.com/tenderlove/fibur
|
68
|
+
licenses: []
|
69
|
+
post_install_message:
|
70
|
+
rdoc_options:
|
71
|
+
- --main
|
72
|
+
- README.rdoc
|
73
|
+
require_paths:
|
74
|
+
- lib
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 1.9.2
|
81
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
requirements: []
|
88
|
+
rubyforge_project: fibur
|
89
|
+
rubygems_version: 1.8.11
|
90
|
+
signing_key:
|
91
|
+
specification_version: 3
|
92
|
+
summary: Fibur is a gem that gives you full concurrency during your I/O calls in Ruby
|
93
|
+
1.9.
|
94
|
+
test_files: []
|