Skip to content
Browse files

write pid file as early as possible, and bump version

  • Loading branch information...
1 parent e8ea720 commit bdcb1149a81b57dd9874b1ddf892f3567c98d3f0 Arya Asemanfar committed Aug 7, 2009
Showing with 8 additions and 5 deletions.
  1. +1 −1 Rakefile
  2. +2 −1 lib/pandemic/server_side/server.rb
  3. +2 −2 pandemic.gemspec
  4. +1 −0 test/pandemic.pid
  5. +2 −1 test/server_test.rb
View
2 Rakefile
@@ -2,7 +2,7 @@ require 'rubygems'
require 'rake'
require 'echoe'
-Echoe.new('pandemic', '0.4.9') do |p|
+Echoe.new('pandemic', '0.5.0') do |p|
p.description = "A framework for distributing work for real-time services and offline tasks."
p.url = "https://github.com/arya/pandemic/"
p.author = "Arya Asemanfar"
View
3 lib/pandemic/server_side/server.rb
@@ -27,6 +27,8 @@ def set_signal_traps(server)
end
attr_reader :host, :port, :running
def initialize(bind_to)
+ write_pid_file
+
@host, @port = host_port(bind_to)
@clients = []
@total_clients = 0
@@ -52,7 +54,6 @@ def start
raise "You must specify a handler" unless @handler
@listener = TCPServer.new(@host, @port)
- write_pid_file
@running = true
@running_since = Time.now
View
4 pandemic.gemspec
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{pandemic}
- s.version = "0.4.9"
+ s.version = "0.5.0"
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
s.authors = ["Arya Asemanfar"]
- s.date = %q{2009-08-04}
+ s.date = %q{2009-08-07}
s.description = %q{A framework for distributing work for real-time services and offline tasks.}
s.email = %q{aryaasemanfar@gmail.com}
s.extra_rdoc_files = ["lib/pandemic/client_side/cluster_connection.rb", "lib/pandemic/client_side/config.rb", "lib/pandemic/client_side/connection.rb", "lib/pandemic/client_side/connection_proxy.rb", "lib/pandemic/client_side/pandemize.rb", "lib/pandemic/connection_pool.rb", "lib/pandemic/mutex_counter.rb", "lib/pandemic/requests_per_second.rb", "lib/pandemic/server_side/client.rb", "lib/pandemic/server_side/config.rb", "lib/pandemic/server_side/handler.rb", "lib/pandemic/server_side/peer.rb", "lib/pandemic/server_side/processor.rb", "lib/pandemic/server_side/request.rb", "lib/pandemic/server_side/server.rb", "lib/pandemic/util.rb", "lib/pandemic.rb", "README.markdown"]
View
1 test/pandemic.pid
@@ -0,0 +1 @@
+50569
View
3 test/server_test.rb
@@ -35,7 +35,6 @@ class ServerTest < Test::Unit::TestCase
Pandemic::ServerSide::Config.expects(:pid_file).at_least_once.returns("test/pandemic.pid")
Pandemic::ServerSide::Config.expects(:servers).at_least_once.returns([])
- @server = Pandemic::ServerSide::Server.new("localhost:4000")
@tcpserver = mock()
TCPServer.expects(:new).with("localhost", 4000).returns(@tcpserver)
@@ -51,6 +50,8 @@ class ServerTest < Test::Unit::TestCase
@tcpserver.expects(:close)
+ @server = Pandemic::ServerSide::Server.new("localhost:4000")
+
@server.handler = mock(:new)
@server.start
wait_for_threads(ignore_threads)

0 comments on commit bdcb114

Please sign in to comment.
Something went wrong with that request. Please try again.