message 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/message/worker.rb +5 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee19d8a22b05ea1f808a9fa3bbdf502d11c48d1b
4
- data.tar.gz: f2c79a4328536efc675c732beb8ad0d97a69450b
3
+ metadata.gz: b6b51098db26856ba5bc4a23817151a3b19994b4
4
+ data.tar.gz: a3e80542109d58412f9aa4092c374a2f6edb7d1c
5
5
  SHA512:
6
- metadata.gz: 45e79a88708e35ad52016f2af849c36365a9e2763617752bb6c696934f496abda8b16f4ce23d3653b60fa824c6eb11177c3f8d0444c220458831fd1a710ed904
7
- data.tar.gz: 1a5263521182fd8d51f0d65b3dc6c828b2d3a7b9df48ad0568b7b08a1d929d81dcf4f8c3e21913e7bb21e3ecad8a8fd98cdb5542f6a7299e61957502af946b86
6
+ metadata.gz: 563beaef23549be1a1a79f79196f40d5189f654d7dc9c47430180e6ac0c8341cf6aaebcc88ba3073d281c3f12249a84ceb64dfe8f099ddd123261880c1346e60
7
+ data.tar.gz: db0cd344f8fc97abeb323542990249a08a5d8552efd62d558569c1e74d9851cbb2cfed71e05c790b5d8ab4580dd6f6f29e55e995b72a580dcfae7a6e2a1662fa
@@ -60,12 +60,14 @@ module Message
60
60
  @default_job = nil
61
61
  @sync = nil
62
62
  @jobs = nil
63
+ @callbacks = nil
64
+ callbacks[:start] << lambda {|job_name, options| Message.log(:info) { "[Worker] start with options #{options.inspect}" } }
65
+ callbacks[:crash] << lambda {|job_name, e| Message.log(:error) { "[Worker] crashed: #{e.message}\n#{e.backtrace.join("\n")}"} }
66
+ callbacks[:stop] << lambda {|job_name| Message.log(:info) { "[Worker] stopped" } }
63
67
  end
64
68
  end
65
69
 
66
- callbacks[:start] << lambda {|job_name, options| Message.log(:info) { "[Worker] start in #{delay}" } }
67
- callbacks[:crash] << lambda {|job_name, e| Message.log(:error) { "[Worker] crashed: #{e.message}\n#{e.backtrace.join("\n")}"} }
68
- callbacks[:stop] << lambda {|job_name| Message.log(:info) { "[Worker] stopped" } }
70
+ reset
69
71
 
70
72
  attr_reader :job_name
71
73
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: message
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xiao Li
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-28 00:00:00.000000000 Z
11
+ date: 2015-06-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Message provides flexible & reliable background/asynchronous job processing mechanism on top of simple queue interface.