pegasus 0.0.1 → 0.0.2
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/VERSION +1 -1
- data/bin/pegasus +10 -2
- data/lib/pegasus/service/class_methods.rb +1 -1
- data/lib/pegasus/service.rb +5 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/bin/pegasus
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'unicorn_horn'
|
3
|
-
|
4
|
-
|
3
|
+
$bootfile = ARGV.shift
|
4
|
+
|
5
|
+
if (ENV['PRELOAD_APP']) then require $bootfile; end
|
6
|
+
|
7
|
+
class LoadWrapper < Struct.new(:klassname)
|
8
|
+
def new; require $bootfile; (eval klassname).new; end
|
9
|
+
end
|
10
|
+
|
11
|
+
handlers = ARGV.map{ |klassname| LoadWrapper.new(klassname) }
|
12
|
+
UnicornHorn::Runner.new( handlers ).start
|
data/lib/pegasus/service.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'logger'
|
1
2
|
require 'thread'
|
2
3
|
require 'pegasus/service/class_methods'
|
3
4
|
require 'pegasus/service/instance_methods'
|
@@ -5,8 +6,10 @@ require 'pegasus/service/instance_methods'
|
|
5
6
|
module Pegasus
|
6
7
|
class Service
|
7
8
|
extend Configurer
|
8
|
-
config :
|
9
|
-
config :
|
9
|
+
config :redis_db do 0; end
|
10
|
+
config :redis_options do {:db => redis_db}; end
|
11
|
+
config :redis do Thread.current[:redis] ||= ::Redis.new(redis_options); end
|
12
|
+
config :blocking_redis do Thread.current[:blredis] ||= ::Redis.new(redis_options.merge(:timeout => 0)); end
|
10
13
|
config :logger do Logger.new(STDERR); end
|
11
14
|
config :serializer do Marshal; end
|
12
15
|
config :redis_prefix do "redis_svc_" end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Joe Edelman
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-15 00:00:00 -07:00
|
18
18
|
default_executable: pegasus
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|