workload 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -3
- data/lib/workload.rb +1 -0
- data/lib/workload/version.rb +1 -1
- metadata +15 -9
- checksums.yaml +0 -7
data/README.md
CHANGED
@@ -25,14 +25,14 @@ with every line of that file and that processing can be done in parallel.
|
|
25
25
|
require "rubygems"
|
26
26
|
require "workload"
|
27
27
|
|
28
|
-
Workload.run do |
|
29
|
-
|
28
|
+
Workload.run do |w|
|
29
|
+
w.produce(1) do |queue| # 1 is the default number of producer threads
|
30
30
|
while line = STDIN.gets
|
31
31
|
queue << line # The pipe is simple ruby Queue
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
|
35
|
+
w.consume(5) do |line| # Here we are spawning 5 consumer threads
|
36
36
|
print "[#{Thread.current[:id]}] consuming line: #{line}"
|
37
37
|
# do something useful with that input
|
38
38
|
end
|
data/lib/workload.rb
CHANGED
data/lib/workload/version.rb
CHANGED
metadata
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Tymon Tobolski
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-29 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
@@ -20,6 +22,7 @@ dependencies:
|
|
20
22
|
type: :development
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - ~>
|
25
28
|
- !ruby/object:Gem::Version
|
@@ -27,15 +30,17 @@ dependencies:
|
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: rake
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- - '>='
|
35
|
+
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: '0'
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- - '>='
|
43
|
+
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: '0'
|
41
46
|
description: Distribute simple tasks to multiple threads with ease
|
@@ -56,26 +61,27 @@ files:
|
|
56
61
|
homepage: http://github.com/monterail/workload
|
57
62
|
licenses:
|
58
63
|
- MIT
|
59
|
-
metadata: {}
|
60
64
|
post_install_message:
|
61
65
|
rdoc_options: []
|
62
66
|
require_paths:
|
63
67
|
- lib
|
64
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
65
70
|
requirements:
|
66
|
-
- - '>='
|
71
|
+
- - ! '>='
|
67
72
|
- !ruby/object:Gem::Version
|
68
73
|
version: '0'
|
69
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
70
76
|
requirements:
|
71
|
-
- - '>='
|
77
|
+
- - ! '>='
|
72
78
|
- !ruby/object:Gem::Version
|
73
79
|
version: '0'
|
74
80
|
requirements: []
|
75
81
|
rubyforge_project:
|
76
|
-
rubygems_version:
|
82
|
+
rubygems_version: 1.8.23
|
77
83
|
signing_key:
|
78
|
-
specification_version:
|
84
|
+
specification_version: 3
|
79
85
|
summary: Distribute simple tasks to multiple threads with ease
|
80
86
|
test_files: []
|
81
87
|
has_rdoc:
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 68f84c27c7e35d59c365cf9a57a3311e2bda1201
|
4
|
-
data.tar.gz: 38bb93842bbc692abd4cbed1c7ba76f4221034d7
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 3272e29e17818a405b50bde1d3c73afdd55078e2065a6afb73973284ddd613992a6aaf3e11932d549fab00d2e55d4fa7687dd228f0ec67b87fd50f9c7e9d2429
|
7
|
-
data.tar.gz: 49a97815d287e89d0c9b5ccab5e53f8e87bc1f5e2751c2a74e52cd0788cae703d3f462694bd99292c302bab68b440f5f6041350511acfb727efb1209b07f0c8a
|