minion 0.1.14 → 0.1.15

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ Jeweler::Tasks.new do |s|
9
9
  s.homepage = "http://github.com/orionz/minion"
10
10
  s.rubyforge_project = "minion"
11
11
  s.files = FileList["[A-Z]*", "{bin,lib,spec}/**/*"]
12
- s.add_dependency "amqp", ">= 0.6.6"
12
+ s.add_dependency "amqp", ">= 0.6.7"
13
13
  s.add_dependency "bunny", ">= 0.6.0"
14
14
  s.add_dependency "json", ">= 1.2.0"
15
15
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.14
1
+ 0.1.15
@@ -8,8 +8,8 @@ include Minion
8
8
 
9
9
  error do |exception,queue,message,headers|
10
10
  puts "got an error processing queue #{queue}"
11
- puts exception.message
12
- puts exception.backtrace
11
+ puts exception.message
12
+ puts exception.backtrace
13
13
  end
14
14
 
15
15
  logger do |msg|
@@ -7,9 +7,9 @@ require 'minion'
7
7
  include Minion
8
8
 
9
9
  error do |exception,queue,message,headers|
10
- puts "got an error processing queue #{queue}"
11
- puts exception.message
12
- puts exception.backtrace
10
+ puts "got an error processing queue #{queue}"
11
+ puts exception.message
12
+ puts exception.backtrace
13
13
  end
14
14
 
15
15
  job "add.bread" do |args|
@@ -25,7 +25,7 @@ job "add.condiments" do |args|
25
25
  end
26
26
 
27
27
  job "eat.sandwich" do |args|
28
- puts "YUM! A #{args['meat']} on #{args['bread']} sandwich with #{args['condiments']}"
28
+ puts "YUM! A #{args['meat']} on #{args['bread']} sandwich with #{args['condiments']}"
29
29
  end
30
30
 
31
31
  enqueue(["add.bread", "add.meat", "add.condiments", "eat.sandwich" ])
@@ -7,9 +7,9 @@ require 'minion'
7
7
  include Minion
8
8
 
9
9
  error do |exception,queue,message,headers|
10
- puts "got an error processing queue #{queue}"
11
- puts exception.message
12
- puts exception.backtrace
10
+ puts "got an error processing queue #{queue}"
11
+ puts exception.message
12
+ puts exception.backtrace
13
13
  end
14
14
 
15
15
  logger do |msg|
@@ -18,7 +18,7 @@ end
18
18
 
19
19
  $listen = true
20
20
 
21
- job "do.once", :when => lambda { $listen } do |args|
21
+ job "do.once", :when => lambda { $listen } do |args|
22
22
  puts "Do this one action - then unsubscribe..."
23
23
  $listen = false
24
24
  end
@@ -7,9 +7,9 @@ require 'minion/handler'
7
7
  module Minion
8
8
  extend self
9
9
 
10
- def url=(url)
11
- @@config_url = url
12
- end
10
+ def url=(url)
11
+ @@config_url = url
12
+ end
13
13
 
14
14
  def enqueue(jobs, data = {})
15
15
  raise "cannot enqueue a nil job" if jobs.nil?
@@ -23,8 +23,9 @@ module Minion
23
23
  queue = jobs
24
24
  end
25
25
 
26
- log "send: #{queue}:#{data.to_json}"
27
- bunny.queue(queue, :durable => true, :auto_delete => false).publish(data.to_json)
26
+ encoded = JSON.dump(data)
27
+ log "send: #{queue}:#{encoded}"
28
+ bunny.queue(queue, :durable => true, :auto_delete => false).publish(encoded)
28
29
  end
29
30
 
30
31
  def log(msg)
@@ -45,11 +46,11 @@ module Minion
45
46
  handler.when = options[:when] if options[:when]
46
47
  handler.unsub = lambda do
47
48
  log "unsubscribing to #{queue}"
48
- MQ.queue(queue).unsubscribe
49
+ MQ.queue(queue, :durable => true, :auto_delete => false).unsubscribe
49
50
  end
50
51
  handler.sub = lambda do
51
52
  log "subscribing to #{queue}"
52
- MQ.queue(queue).subscribe(:ack => true) do |h,m|
53
+ MQ.queue(queue, :durable => true, :auto_delete => false).subscribe(:ack => true) do |h,m|
53
54
  return if AMQP.closing?
54
55
  begin
55
56
  log "recv: #{queue}:#{m}"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 14
9
- version: 0.1.14
8
+ - 15
9
+ version: 0.1.15
10
10
  platform: ruby
11
11
  authors:
12
12
  - Orion Henry
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-27 00:00:00 -07:00
17
+ date: 2010-07-28 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -27,8 +27,8 @@ dependencies:
27
27
  segments:
28
28
  - 0
29
29
  - 6
30
- - 6
31
- version: 0.6.6
30
+ - 7
31
+ version: 0.6.7
32
32
  type: :runtime
33
33
  version_requirements: *id001
34
34
  - !ruby/object:Gem::Dependency