em-sequence 0.1.0 → 0.1.1
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.
- data/README.md +4 -0
- data/VERSION +1 -1
- data/em-sequence.gemspec +3 -3
- data/lib/em-sequence.rb +16 -1
- data/lib/em-sequence/block.rb +1 -1
- data/lib/em-sequence/method.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -67,6 +67,10 @@ non-multiplexed (and non-callbacked calculator):
|
|
67
67
|
# |
|
68
68
|
puts result.inspect # V
|
69
69
|
|
70
|
+
If you don't expect any result, you can simply call:
|
71
|
+
EM::Sequence::run(Calculator::new) do
|
72
|
+
# some declaration, see above
|
73
|
+
end
|
70
74
|
|
71
75
|
Contributing
|
72
76
|
------------
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/em-sequence.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{em-sequence}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Martin Kozák"]
|
12
|
-
s.date = %q{2011-02-
|
12
|
+
s.date = %q{2011-02-27}
|
13
13
|
s.email = %q{martinkozak@martinkozak.net}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE.txt",
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.homepage = %q{https://github.com/martinkozak/em-sequence}
|
33
33
|
s.licenses = ["MIT"]
|
34
34
|
s.require_paths = ["lib"]
|
35
|
-
s.rubygems_version = %q{1.5.
|
35
|
+
s.rubygems_version = %q{1.5.3}
|
36
36
|
s.summary = %q{Third approach to EventMachine lightweight concurrency. Runs declared methods and blocks in sequence, each in one tick. So allows calls chaining with keeping the EventMachine multiplexing facility on.}
|
37
37
|
|
38
38
|
if s.respond_to? :specification_version then
|
data/lib/em-sequence.rb
CHANGED
@@ -8,7 +8,7 @@ require 'em-sequence/method'
|
|
8
8
|
|
9
9
|
##
|
10
10
|
# Main EventMachine module.
|
11
|
-
# @see
|
11
|
+
# @see http://rubyeventmachine.com/
|
12
12
|
#
|
13
13
|
|
14
14
|
module EM
|
@@ -56,6 +56,7 @@ module EM
|
|
56
56
|
##
|
57
57
|
# Constructor.
|
58
58
|
# @param [Object] target target instance for the sequence
|
59
|
+
#
|
59
60
|
|
60
61
|
def initialize(target)
|
61
62
|
@target = target
|
@@ -163,5 +164,19 @@ module EM
|
|
163
164
|
|
164
165
|
worker.call()
|
165
166
|
end
|
167
|
+
|
168
|
+
##
|
169
|
+
# Declares and runs specified block in one call. Useful if you
|
170
|
+
# don't expect any results.
|
171
|
+
#
|
172
|
+
# @param [Object] target target instance for the sequence
|
173
|
+
# @param [Proc] block sequence declaration
|
174
|
+
# @see #declare
|
175
|
+
# @since 0.1.1
|
176
|
+
#
|
177
|
+
|
178
|
+
def self.run(target, &block)
|
179
|
+
self::new(target).declare(&block).run!
|
180
|
+
end
|
166
181
|
end
|
167
182
|
end
|
data/lib/em-sequence/block.rb
CHANGED
data/lib/em-sequence/method.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: em-sequence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- "Martin Koz\xC3\xA1k"
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-02-
|
13
|
+
date: 2011-02-27 00:00:00 +01:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -93,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
hash:
|
96
|
+
hash: -4534630292098080995
|
97
97
|
segments:
|
98
98
|
- 0
|
99
99
|
version: "0"
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
requirements: []
|
107
107
|
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 1.5.
|
109
|
+
rubygems_version: 1.5.3
|
110
110
|
signing_key:
|
111
111
|
specification_version: 3
|
112
112
|
summary: Third approach to EventMachine lightweight concurrency. Runs declared methods and blocks in sequence, each in one tick. So allows calls chaining with keeping the EventMachine multiplexing facility on.
|