peon 0.1.1 → 0.1.2
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/VERSION +1 -1
- data/lib/peon.rb +4 -1
- data/peon.gemspec +5 -4
- metadata +2 -2
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.2
|
data/lib/peon.rb
CHANGED
|
@@ -8,6 +8,8 @@ require 'peon/handler'
|
|
|
8
8
|
module Peon
|
|
9
9
|
extend self
|
|
10
10
|
|
|
11
|
+
@@already_running = false
|
|
12
|
+
|
|
11
13
|
def enqueue(jobs, data = {})
|
|
12
14
|
if jobs.respond_to? :shift
|
|
13
15
|
queue = jobs.shift
|
|
@@ -47,7 +49,7 @@ module Peon
|
|
|
47
49
|
end
|
|
48
50
|
handler.task = blk
|
|
49
51
|
@@handlers ||= {}
|
|
50
|
-
at_exit { Peon.run } if @@handlers.size == 0
|
|
52
|
+
at_exit { Peon.run unless @@already_running == true } if @@handlers.size == 0
|
|
51
53
|
@@handlers[queue] = handler
|
|
52
54
|
end
|
|
53
55
|
|
|
@@ -80,6 +82,7 @@ module Peon
|
|
|
80
82
|
|
|
81
83
|
def run
|
|
82
84
|
log "Starting up"
|
|
85
|
+
@@already_running = true
|
|
83
86
|
|
|
84
87
|
Signal.trap('INT') { EM.stop }
|
|
85
88
|
Signal.trap('TERM') { EM.stop }
|
data/peon.gemspec
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# Generated by jeweler
|
|
2
|
-
# DO NOT EDIT THIS FILE
|
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{peon}
|
|
8
|
-
s.version = "0.1.
|
|
8
|
+
s.version = "0.1.2"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Charlie Melbye"]
|
|
12
|
-
s.date = %q{2009-
|
|
12
|
+
s.date = %q{2009-12-05}
|
|
13
13
|
s.description = %q{Peon is a work queue library for Ruby with an awesome DSL for defining jobs, and it's compatible with the beanstalkd message queue.}
|
|
14
14
|
s.email = %q{charlie@pushyapp.com}
|
|
15
15
|
s.files = [
|
|
@@ -49,3 +49,4 @@ Gem::Specification.new do |s|
|
|
|
49
49
|
s.add_dependency(%q<json>, [">= 1.1.9"])
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
|
+
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: peon
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Charlie Melbye
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-
|
|
12
|
+
date: 2009-12-05 00:00:00 -06:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|