pigeon 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/pigeon/processor.rb +10 -4
- data/lib/pigeon/queue.rb +5 -3
- data/lib/pigeon/task.rb +1 -0
- data/pigeon.gemspec +3 -3
- metadata +4 -4
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ begin
|
|
8
8
|
gem.summary = %Q{Simple daemonized EventMachine engine framework with plug-in support}
|
9
9
|
gem.description = %Q{Pigeon is a simple way to get started building an EventMachine engine that's intended to run as a background job.}
|
10
10
|
gem.email = "github@tadman.ca"
|
11
|
-
gem.homepage = "http://github.com/
|
11
|
+
gem.homepage = "http://github.com/twg/pigeon"
|
12
12
|
gem.authors = %w[ tadman ]
|
13
13
|
gem.add_development_dependency 'eventmachine'
|
14
14
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.8
|
data/lib/pigeon/processor.rb
CHANGED
@@ -72,11 +72,17 @@ class Pigeon::Processor
|
|
72
72
|
protected
|
73
73
|
def switch_to_next_task!
|
74
74
|
@lock.synchronize do
|
75
|
+
if (@task)
|
76
|
+
@task.processor = nil
|
77
|
+
end
|
78
|
+
|
75
79
|
@task = nil
|
76
|
-
|
77
|
-
if (@
|
78
|
-
@task.
|
79
|
-
|
80
|
+
|
81
|
+
if (@queue)
|
82
|
+
if (@task = @queue.pop(&@filter))
|
83
|
+
@task.run!(self) do
|
84
|
+
switch_to_next_task!
|
85
|
+
end
|
80
86
|
end
|
81
87
|
end
|
82
88
|
end
|
data/lib/pigeon/queue.rb
CHANGED
@@ -134,6 +134,10 @@ class Pigeon::Queue
|
|
134
134
|
|
135
135
|
# Adds a task to the queue.
|
136
136
|
def <<(task)
|
137
|
+
unless (task.is_a?(Pigeon::Task))
|
138
|
+
raise "Cannot add task of class #{task.class} to #{self.class}"
|
139
|
+
end
|
140
|
+
|
137
141
|
# If there is an insert operation already in progress, put this task in
|
138
142
|
# the backlog for subsequent processing.
|
139
143
|
|
@@ -147,9 +151,7 @@ class Pigeon::Queue
|
|
147
151
|
while (active_task) do
|
148
152
|
# Set the claimable task flag for this task since it is not yet in the
|
149
153
|
# actual task queue.
|
150
|
-
@
|
151
|
-
@claimable_task[active_task] = true
|
152
|
-
end
|
154
|
+
@claimable_task[active_task] = true
|
153
155
|
|
154
156
|
unless (@observers.empty?)
|
155
157
|
@observer_lock.synchronize do
|
data/lib/pigeon/task.rb
CHANGED
data/pigeon.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{pigeon}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["tadman"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-01-06}
|
13
13
|
s.default_executable = %q{launcher.example}
|
14
14
|
s.description = %q{Pigeon is a simple way to get started building an EventMachine engine that's intended to run as a background job.}
|
15
15
|
s.email = %q{github@tadman.ca}
|
@@ -53,7 +53,7 @@ Gem::Specification.new do |s|
|
|
53
53
|
"test/unit/pigeon_task_test.rb",
|
54
54
|
"test/unit/pigeon_test.rb"
|
55
55
|
]
|
56
|
-
s.homepage = %q{http://github.com/
|
56
|
+
s.homepage = %q{http://github.com/twg/pigeon}
|
57
57
|
s.rdoc_options = ["--charset=UTF-8"]
|
58
58
|
s.require_paths = ["lib"]
|
59
59
|
s.rubygems_version = %q{1.3.7}
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 0.4.
|
8
|
+
- 8
|
9
|
+
version: 0.4.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- tadman
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-01-06 00:00:00 -05:00
|
18
18
|
default_executable: launcher.example
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -74,7 +74,7 @@ files:
|
|
74
74
|
- test/unit/pigeon_task_test.rb
|
75
75
|
- test/unit/pigeon_test.rb
|
76
76
|
has_rdoc: true
|
77
|
-
homepage: http://github.com/
|
77
|
+
homepage: http://github.com/twg/pigeon
|
78
78
|
licenses: []
|
79
79
|
|
80
80
|
post_install_message:
|