From df58b5249c3e17ee4fab448224e3f043a2444fa0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 29 Mar 2009 18:10:14 -0700 Subject: configurator: favor "listen" directive over "listeners" We still need to support "listeners" for easy use of command-line options, but folks using the config file should use "listen" as it is more flexible. --- lib/unicorn/configurator.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb index 4a085a1..a69e971 100644 --- a/lib/unicorn/configurator.rb +++ b/lib/unicorn/configurator.rb @@ -8,7 +8,8 @@ module Unicorn # # Example (when used with the unicorn config file): # worker_processes 4 - # listeners %w(0.0.0.0:9292 /tmp/my_app.sock) + # listen '/tmp/my_app.sock', :backlog => 1 + # listen '0.0.0.0:9292' # timeout 10 # pid "/tmp/my_app.pid" # after_fork do |server,worker_nr| @@ -23,7 +24,7 @@ module Unicorn # Default settings for Unicorn DEFAULTS = { :timeout => 60, - :listeners => [ Const::DEFAULT_LISTEN ], + :listeners => [], :logger => DEFAULT_LOGGER, :worker_processes => 1, :after_fork => lambda { |server, worker_nr| @@ -153,7 +154,9 @@ module Unicorn # sets listeners to the given +addresses+, replacing or augmenting the # current set. This is for the global listener pool shared by all # worker processes. For per-worker listeners, see the after_fork example - def listeners(addresses) + # This is for internal API use only, do not use it in your Unicorn + # config file. Use listen instead. + def listeners(addresses) # :nodoc: Array === addresses or addresses = Array(addresses) addresses.map! { |addr| expand_addr(addr) } @set[:listeners] = addresses -- cgit v1.2.3-24-ge0c7