about summary refs log tree commit homepage
path: root/lib/yahns/server.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2013-10-30 01:50:12 +0000
committerEric Wong <normalperson@yhbt.net>2013-10-30 07:00:55 +0000
commit68fc0c10468f0fefa6777bdabf4712d33de1aa42 (patch)
tree46ed4bd684bed91c3440a1d57c9790db7b91896a /lib/yahns/server.rb
parent72e20c9d7aac1837f1565cff5856e50c692304be (diff)
downloadyahns-68fc0c10468f0fefa6777bdabf4712d33de1aa42.tar.gz
This is probably not needed and just adds contention, but it makes
experimenting easier.

While we're at it, validate minimum values of for sndbuf/rcvbuf
along with this new threads value, too.
Diffstat (limited to 'lib/yahns/server.rb')
-rw-r--r--lib/yahns/server.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/yahns/server.rb b/lib/yahns/server.rb
index 396b653..d7f1b54 100644
--- a/lib/yahns/server.rb
+++ b/lib/yahns/server.rb
@@ -341,11 +341,13 @@ class Yahns::Server # :nodoc:
 
     # spin up acceptor threads, clients flow into worker queues after this
     @listeners.each do |l|
-      ctx = sock_opts(l)[:yahns_app_ctx]
+      opts = sock_opts(l)
+      ctx = opts[:yahns_app_ctx]
       qegg = ctx.qegg || @config.qeggs[:default]
+      q = queues[qegg] ||= qegg_vivify(qegg, fdmap)
 
       # acceptors feed the the queues
-      l.spawn_acceptor(@logger, ctx, queues[qegg] ||= qegg_vivify(qegg, fdmap))
+      l.spawn_acceptor(opts[:threads] || 1, @logger, ctx, q)
     end
     fdmap
   end