message 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/message/worker.rb +5 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6b51098db26856ba5bc4a23817151a3b19994b4
|
4
|
+
data.tar.gz: a3e80542109d58412f9aa4092c374a2f6edb7d1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 563beaef23549be1a1a79f79196f40d5189f654d7dc9c47430180e6ac0c8341cf6aaebcc88ba3073d281c3f12249a84ceb64dfe8f099ddd123261880c1346e60
|
7
|
+
data.tar.gz: db0cd344f8fc97abeb323542990249a08a5d8552efd62d558569c1e74d9851cbb2cfed71e05c790b5d8ab4580dd6f6f29e55e995b72a580dcfae7a6e2a1662fa
|
data/lib/message/worker.rb
CHANGED
@@ -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
|
-
|
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.
|
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-
|
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.
|