rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
blob c4269dfd6e6733d9034285006cebe4eea1ec10a2 534 bytes (raw)
$ git show HEAD:lib/rainbows/socket_proxy.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 
# -*- encoding: binary -*-
# :enddoc:
#
module Rainbows::SocketProxy
  def kgio_addr
    to_io.kgio_addr
  end

  def kgio_read(size, buf = "")
    to_io.kgio_read(size, buf)
  end

  def kgio_read!(size, buf = "")
    to_io.kgio_read!(size, buf)
  end

  def kgio_trywrite(buf)
    to_io.kgio_trywrite(buf)
  end

  def kgio_tryread(size, buf = "")
    to_io.kgio_tryread(size, buf)
  end

  def kgio_wait_readable(timeout = nil)
    to_io.kgio_wait_readable(timeout)
  end

  def timed_read(buf)
    to_io.timed_read(buf)
  end
end

git clone https://yhbt.net/rainbows.git