pegasus 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/bin/pegasus CHANGED
@@ -1,4 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'unicorn_horn'
3
- require ARGV.shift
4
- UnicornHorn::Runner.new( eval "[#{ARGV.join(',')}]" ).start
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
@@ -33,7 +33,7 @@ module Pegasus
33
33
  end
34
34
 
35
35
  def wait ticket_no
36
- @instance.playout if @instance
36
+ playout if @instance
37
37
  logger.debug "waiting on ticket #{ticket_no}"
38
38
  blpop ticket_no, 0
39
39
  del ticket_no
@@ -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 :redis do Thread.current[:redis] ||= ::Redis.new; end
9
- config :blocking_redis do Thread.current[:blocking_redis] ||= ::Redis.new(:timeout=>0); end
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
- - 1
9
- version: 0.0.1
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-09 00:00:00 -04:00
17
+ date: 2010-09-15 00:00:00 -07:00
18
18
  default_executable: pegasus
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency