background_lite 0.0.1 → 0.1.0
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/README.rdoc +5 -3
- data/lib/{background.rb → background_lite/background.rb} +7 -1
- data/lib/{core_ext → background_lite/core_ext}/class.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/error_reporters/exception_notification_error_reporter.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/error_reporters/silent_error_reporter.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/error_reporters/stderr_error_reporter.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/error_reporters/stdout_error_reporter.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/error_reporters/test_error_reporter.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/handlers/active_messaging_handler.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/handlers/disk_handler.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/handlers/drb_handler.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/handlers/forget_handler.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/handlers/fork_handler.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/handlers/in_process_handler.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/handlers/resque_handler.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/handlers/runner_handler.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/handlers/test_handler.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/nil_class.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/numeric.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/object.rb +0 -0
- data/lib/{core_ext → background_lite/core_ext}/symbol.rb +0 -0
- data/lib/{rails_ext → background_lite/rails_ext}/activerecord/base.rb +0 -0
- data/lib/background_lite.rb +13 -0
- metadata +31 -25
data/README.rdoc
CHANGED
@@ -45,9 +45,9 @@ background tasks, as well as forking.
|
|
45
45
|
* Background processing using multiple background processing frameworks.
|
46
46
|
* Fallback processing, if your background processing framework isn't responding
|
47
47
|
correctly.
|
48
|
-
* Works out-of-the-box with script/runner and forking.
|
48
|
+
* Works out-of-the-box with script/runner and forking and DRb.
|
49
49
|
* Fallback handler that streams messages containing background tasks to disk, to
|
50
|
-
later .
|
50
|
+
later replay jobs that failed because of a temporary error.
|
51
51
|
* Error reporting through different channels, depending on the task at hand.
|
52
52
|
* Exception notification.
|
53
53
|
* Stdout (useful for debugging).
|
@@ -55,8 +55,10 @@ background tasks, as well as forking.
|
|
55
55
|
* Silent, which swallows all exceptions.
|
56
56
|
* Supported processing frameworks.
|
57
57
|
* ActiveMessaging.
|
58
|
+
* Resque
|
58
59
|
* script/runner.
|
59
60
|
* fork (works only on Unix-like environments).
|
61
|
+
* DRb with an example runner in scripts/background_queue (not really suitable for production use)
|
60
62
|
* others might follow (it's really easy to write a handler).
|
61
63
|
* Easy configuration, depending on the environment, in config/background.yml.
|
62
64
|
* Ability to override the configuration per method.
|
@@ -76,4 +78,4 @@ Depending on the background processing framework that you are using, you might
|
|
76
78
|
have to do some configuration. See the documentation of the respective
|
77
79
|
background handler for details.
|
78
80
|
|
79
|
-
Copyright (c) 2008-
|
81
|
+
Copyright (c) 2008-2010 imedo GmbH, released under the MIT license
|
@@ -19,7 +19,13 @@ module BackgroundLite
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.default_config #:nodoc:
|
22
|
-
@default_config ||=
|
22
|
+
@default_config ||= begin
|
23
|
+
if config[RAILS_ENV]
|
24
|
+
(config[RAILS_ENV]['default'] || config['default'] || {})
|
25
|
+
else
|
26
|
+
(config['default'] || {})
|
27
|
+
end
|
28
|
+
end
|
23
29
|
end
|
24
30
|
|
25
31
|
def self.load(configuration) #:nodoc:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/background_lite/background'
|
2
|
+
require File.dirname(__FILE__) + '/background_lite/core_ext/object'
|
3
|
+
require File.dirname(__FILE__) + '/background_lite/core_ext/class'
|
4
|
+
require File.dirname(__FILE__) + '/background_lite/core_ext/numeric'
|
5
|
+
require File.dirname(__FILE__) + '/background_lite/core_ext/symbol'
|
6
|
+
require File.dirname(__FILE__) + '/background_lite/core_ext/nil_class'
|
7
|
+
Dir.glob(File.dirname(__FILE__) + '/background_lite/core_ext/handlers/*.rb').each do |handler|
|
8
|
+
require handler
|
9
|
+
end
|
10
|
+
Dir.glob(File.dirname(__FILE__) + '/background_lite/core_ext/error_reporters/*.rb').each do |reporter|
|
11
|
+
require reporter
|
12
|
+
end
|
13
|
+
require File.dirname(__FILE__) + '/background_lite/rails_ext/activerecord/base'
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: background_lite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
|
-
- 0
|
8
8
|
- 1
|
9
|
-
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Thomas Kadauke
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-08-09 00:00:00 +02:00
|
18
19
|
default_executable:
|
19
20
|
dependencies: []
|
20
21
|
|
@@ -27,27 +28,28 @@ extensions: []
|
|
27
28
|
extra_rdoc_files:
|
28
29
|
- README.rdoc
|
29
30
|
files:
|
30
|
-
- lib/background.rb
|
31
|
-
- lib/core_ext/class.rb
|
32
|
-
- lib/core_ext/error_reporters/exception_notification_error_reporter.rb
|
33
|
-
- lib/core_ext/error_reporters/silent_error_reporter.rb
|
34
|
-
- lib/core_ext/error_reporters/stderr_error_reporter.rb
|
35
|
-
- lib/core_ext/error_reporters/stdout_error_reporter.rb
|
36
|
-
- lib/core_ext/error_reporters/test_error_reporter.rb
|
37
|
-
- lib/core_ext/handlers/active_messaging_handler.rb
|
38
|
-
- lib/core_ext/handlers/disk_handler.rb
|
39
|
-
- lib/core_ext/handlers/drb_handler.rb
|
40
|
-
- lib/core_ext/handlers/forget_handler.rb
|
41
|
-
- lib/core_ext/handlers/fork_handler.rb
|
42
|
-
- lib/core_ext/handlers/in_process_handler.rb
|
43
|
-
- lib/core_ext/handlers/resque_handler.rb
|
44
|
-
- lib/core_ext/handlers/runner_handler.rb
|
45
|
-
- lib/core_ext/handlers/test_handler.rb
|
46
|
-
- lib/core_ext/nil_class.rb
|
47
|
-
- lib/core_ext/numeric.rb
|
48
|
-
- lib/core_ext/object.rb
|
49
|
-
- lib/core_ext/symbol.rb
|
50
|
-
- lib/rails_ext/activerecord/base.rb
|
31
|
+
- lib/background_lite/background.rb
|
32
|
+
- lib/background_lite/core_ext/class.rb
|
33
|
+
- lib/background_lite/core_ext/error_reporters/exception_notification_error_reporter.rb
|
34
|
+
- lib/background_lite/core_ext/error_reporters/silent_error_reporter.rb
|
35
|
+
- lib/background_lite/core_ext/error_reporters/stderr_error_reporter.rb
|
36
|
+
- lib/background_lite/core_ext/error_reporters/stdout_error_reporter.rb
|
37
|
+
- lib/background_lite/core_ext/error_reporters/test_error_reporter.rb
|
38
|
+
- lib/background_lite/core_ext/handlers/active_messaging_handler.rb
|
39
|
+
- lib/background_lite/core_ext/handlers/disk_handler.rb
|
40
|
+
- lib/background_lite/core_ext/handlers/drb_handler.rb
|
41
|
+
- lib/background_lite/core_ext/handlers/forget_handler.rb
|
42
|
+
- lib/background_lite/core_ext/handlers/fork_handler.rb
|
43
|
+
- lib/background_lite/core_ext/handlers/in_process_handler.rb
|
44
|
+
- lib/background_lite/core_ext/handlers/resque_handler.rb
|
45
|
+
- lib/background_lite/core_ext/handlers/runner_handler.rb
|
46
|
+
- lib/background_lite/core_ext/handlers/test_handler.rb
|
47
|
+
- lib/background_lite/core_ext/nil_class.rb
|
48
|
+
- lib/background_lite/core_ext/numeric.rb
|
49
|
+
- lib/background_lite/core_ext/object.rb
|
50
|
+
- lib/background_lite/core_ext/symbol.rb
|
51
|
+
- lib/background_lite/rails_ext/activerecord/base.rb
|
52
|
+
- lib/background_lite.rb
|
51
53
|
- rails/init.rb
|
52
54
|
- init.rb
|
53
55
|
- README.rdoc
|
@@ -61,23 +63,27 @@ rdoc_options: []
|
|
61
63
|
require_paths:
|
62
64
|
- lib
|
63
65
|
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
64
67
|
requirements:
|
65
68
|
- - ">="
|
66
69
|
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
67
71
|
segments:
|
68
72
|
- 0
|
69
73
|
version: "0"
|
70
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
71
76
|
requirements:
|
72
77
|
- - ">="
|
73
78
|
- !ruby/object:Gem::Version
|
79
|
+
hash: 3
|
74
80
|
segments:
|
75
81
|
- 0
|
76
82
|
version: "0"
|
77
83
|
requirements: []
|
78
84
|
|
79
85
|
rubyforge_project:
|
80
|
-
rubygems_version: 1.3.
|
86
|
+
rubygems_version: 1.3.7
|
81
87
|
signing_key:
|
82
88
|
specification_version: 3
|
83
89
|
summary: Run any method in the background
|