background_worker 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/background_worker.rb +1 -3
- data/lib/background_worker/base.rb +4 -2
- data/lib/background_worker/config.rb +1 -2
- data/lib/background_worker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8571c96ec0aca2ab3d9cf9f4fc0aa283152b77af
|
4
|
+
data.tar.gz: 51694792968c8e536ad250b6384de5d9a5c82c8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4c475813fd08d41afe57a2d19ec98ce0646bfc5dd872189fd451adaedf8bee3dca36cccdcf1b8c5ad8fa7402515d84dbf7835f6f1eeb6df4c19d765a8248d4e
|
7
|
+
data.tar.gz: 81a60b3710d2592f14e150998fa49a1232778f69c9e93a86e0bc5ab11285552f8aaf2636b6082aa324a8ae90659adf96bcee175ab4f88372cbd7d9ce96494259
|
data/lib/background_worker.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
require 'background_worker/version'
|
2
2
|
require 'background_worker/config'
|
3
|
-
require 'background_worker/uid'
|
4
3
|
require 'background_worker/base'
|
5
|
-
require 'background_worker/persistent_state'
|
6
4
|
|
7
5
|
module BackgroundWorker
|
8
6
|
# Configure worker
|
@@ -35,7 +33,7 @@ module BackgroundWorker
|
|
35
33
|
end
|
36
34
|
|
37
35
|
def self.config
|
38
|
-
|
36
|
+
fail 'Not configured!' unless @config
|
39
37
|
@config
|
40
38
|
end
|
41
39
|
|
@@ -1,3 +1,7 @@
|
|
1
|
+
require 'background_worker/uid'
|
2
|
+
require 'background_worker/persistent_state'
|
3
|
+
require 'background_worker/worker_execution'
|
4
|
+
|
1
5
|
module BackgroundWorker
|
2
6
|
class Base
|
3
7
|
attr_accessor :uid, :state
|
@@ -75,11 +79,9 @@ module BackgroundWorker
|
|
75
79
|
def perform(method_name, options = {})
|
76
80
|
BackgroundWorker.verify_active_connections!
|
77
81
|
|
78
|
-
|
79
82
|
worker = new(options)
|
80
83
|
execution = WorkerExecution.new(worker, method_name, options)
|
81
84
|
execution.call
|
82
|
-
|
83
85
|
end
|
84
86
|
end
|
85
87
|
end
|