Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

log file/level now specify-able. bumped version.

  • Loading branch information...
commit afe6031a6148d98d20529936db55dac1dd690d0d 1 parent b8899ab
@arya authored
Showing with 11 additions and 13 deletions.
  1. +4 −0 README.markdown
  2. +1 −1  Rakefile
  3. +4 −10 lib/pandemic.rb
  4. +2 −2 pandemic.gemspec
View
4 README.markdown
@@ -119,6 +119,10 @@ The servers are going to try to bind to localhost:4000 and localhost:4001 so mak
By default, the handler runs in the same Ruby process as Pandemic. By setting the fork\_for\_processor to true in pandemic\_server.yml, you can have Pandemic fork to new processes to run the process method. This is particularly useful when your process method goes to MySQL which locks the entire process until MySQL returns.
## Change History
+**Version 0.4.2**
+
+ * Log file and log level now specify-able as hash attributes to the _epidemic!_ method.
+
**Version 0.3.1**
* Changed map to partition to more accurately reflect what it does. This breaks backwards compatibility, but all you have to do is rename your method.
View
2  Rakefile
@@ -2,7 +2,7 @@ require 'rubygems'
require 'rake'
require 'echoe'
-Echoe.new('pandemic', '0.4.1') do |p|
+Echoe.new('pandemic', '0.4.2') 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
14 lib/pandemic.rb
@@ -25,22 +25,16 @@
require 'pandemic/client_side/connection_proxy'
require 'pandemic/client_side/pandemize'
-# TODO:
-# - tests
-# - IO timeouts/robustness
-# - documentation
-# - PING/PONG?
-
TCP_NO_DELAY_AVAILABLE =
RUBY_VERSION < '1.9' ? Socket.constants.include?('TCP_NODELAY') : Socket.constants.include?(:TCP_NODELAY)
-def epidemic!(bind_to = nil)
+def epidemic!(options = {})
if $pandemic_logger.nil?
- $pandemic_logger = Logger.new("pandemic.log")
- $pandemic_logger.level = Logger::INFO
+ $pandemic_logger = Logger.new(options[:log_file] || "pandemic.log")
+ $pandemic_logger.level = options[:log_level] || Logger::INFO
$pandemic_logger.datetime_format = "%Y-%m-%d %H:%M:%S "
end
- Pandemic::ServerSide::Server.boot(bind_to)
+ Pandemic::ServerSide::Server.boot(options[:bind_to])
end
::Pandemize = Pandemic::ClientSide::Pandemize
View
4 pandemic.gemspec
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{pandemic}
- s.version = "0.4.1"
+ s.version = "0.4.2"
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
s.authors = ["Arya Asemanfar"]
- s.date = %q{2009-07-12}
+ s.date = %q{2009-07-19}
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/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"]
Please sign in to comment.
Something went wrong with that request. Please try again.