yahns Ruby server user/dev discussion
 help / color / Atom feed
* [PATCH] server_mp: favor "Kernel#select" instead of "IO.select"
@ 2018-12-28  0:33 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2018-12-28  0:33 UTC (permalink / raw)
  To: yahns-public

Golfing to eliminate a constant lookup and inline-constant-cache entry
---
 lib/yahns/server_mp.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/yahns/server_mp.rb b/lib/yahns/server_mp.rb
index c9cd207..7b2f9b7 100644
--- a/lib/yahns/server_mp.rb
+++ b/lib/yahns/server_mp.rb
@@ -159,7 +159,7 @@ def run_mp_worker(worker)
   def mp_sig_handle(watch, alive)
     # not performance critical
     watch.delete_if { |io| io.to_io.closed? }
-    if r = IO.select(watch, nil, nil, alive ? nil : 0.1)
+    if r = select(watch, nil, nil, alive ? nil : 0.1)
       r[0].each(&:yahns_step)
     end
     case @sig_queue.shift
-- 
EW


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-28  0:33 [PATCH] server_mp: favor "Kernel#select" instead of "IO.select" Eric Wong

yahns Ruby server user/dev discussion

Archives are clonable:
	git clone --mirror https://yhbt.net/yahns-public
	git clone --mirror http://ou63pmih66umazou.onion/yahns-public

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.yahns
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.yahns

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox