allora 0.0.7 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +4 -4
- data/lib/allora/backend/redis.rb +6 -5
- data/lib/allora/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1eacbacaec66296ab84d3bfc4e0cc5923a1e2498
|
4
|
+
data.tar.gz: 3ea1d12abb16a7ac44cf4351b962a841ef9ff02e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fb32dedc278e182b9b3b9734d9b23ca1bef12d35aecea339b32597021cf1740490672350003aadc8a492b84976883ee97289a6be52713470434cc771141ab43
|
7
|
+
data.tar.gz: 35903bda8120eab4fe1c23461e6af665a35116d681339b2c69388a518e72ba2d91a937c5dbea6f684d30336b7ce57c5e32f6cdba0b905d54a17898d19e053fa2
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -43,7 +43,7 @@ Create a file, for example "schedule.rb":
|
|
43
43
|
Allora.start(:join => true) do |s|
|
44
44
|
# a job that runs hourly
|
45
45
|
s.add("empty_cache", :every => 1.hour) { `rm -f /path/to/cache/*` }
|
46
|
-
|
46
|
+
|
47
47
|
# a job that runs based on a cron string
|
48
48
|
s.add("update_stats", :cron => "0 2,14 * * *") { Resque.enqueue(UpdateStatsJob) }
|
49
49
|
end
|
@@ -58,16 +58,16 @@ In the following example, we specify to use a Redis backend, which is safe to ru
|
|
58
58
|
multiple machines:
|
59
59
|
|
60
60
|
require "redis"
|
61
|
-
|
61
|
+
|
62
62
|
Allora.start(:backend => :redis, :host => "redis.lan", :join => true) do |s|
|
63
63
|
# a job that runs hourly
|
64
64
|
s.add("empty_cache", :every => 1.hour) { `rm -f /path/to/cache/*` }
|
65
|
-
|
65
|
+
|
66
66
|
# a job that runs based on a cron string
|
67
67
|
s.add("update_stats", :cron => "0 2,14 * * *") { Resque.enqueue(UpdateStatsJob) }
|
68
68
|
end
|
69
69
|
|
70
|
-
We specify a redis host (and port) so that schedule data can be shared.
|
70
|
+
We specify a redis host (and port) so that schedule data can be shared. The following options will be passed through to `Redis.new` and can be used to customize your connection settings: `:url`, `:port`, `:host`, `:db`, `:path`, `:password`.
|
71
71
|
|
72
72
|
Note that you must load redis yourself. Allora does not directly depend on it, so that users
|
73
73
|
may choose not to use it.
|
data/lib/allora/backend/redis.rb
CHANGED
@@ -67,11 +67,12 @@ module Allora
|
|
67
67
|
def create_redis(opts)
|
68
68
|
return opts[:client] if opts.key?(:client)
|
69
69
|
|
70
|
-
::Redis.new(
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
70
|
+
::Redis.new(redis_opts(opts).merge(:thread_safe => true))
|
71
|
+
end
|
72
|
+
|
73
|
+
def redis_opts(opts)
|
74
|
+
keys = [:host, :port, :db, :url, :path, :password]
|
75
|
+
keys.each_with_object({}) { |k, hash| hash[k] = opts[k] if opts.has_key?(k) }
|
75
76
|
end
|
76
77
|
|
77
78
|
# Forces all job data to be re-entered into Redis at the next poll
|
data/lib/allora/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- d11wtq
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -38,6 +38,7 @@ extensions: []
|
|
38
38
|
extra_rdoc_files: []
|
39
39
|
files:
|
40
40
|
- .gitignore
|
41
|
+
- CHANGELOG.md
|
41
42
|
- Gemfile
|
42
43
|
- LICENSE
|
43
44
|
- README.md
|
@@ -72,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
73
|
version: '0'
|
73
74
|
requirements: []
|
74
75
|
rubyforge_project: allora
|
75
|
-
rubygems_version: 2.0.
|
76
|
+
rubygems_version: 2.0.14
|
76
77
|
signing_key:
|
77
78
|
specification_version: 4
|
78
79
|
summary: A ruby scheduler that keeps it simple, with support for distributed schedules
|