Rainbows! Rack HTTP server user/dev discussion
 help / color / Atom feed
3f0ec4ae577deaff9306164bbbac2f148a0185d7 blob 1057 bytes (raw)

 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
33
 
# -*- encoding: binary -*-
require 'rainbows/fiber'

# Simple Fiber-based concurrency model for 1.9.  This spawns a new Fiber
# for every incoming client connection and the root Fiber for scheduling
# and connection acceptance.
#
# This concurrency model is difficult to use with existing applications,
# lacks third-party support, and is thus NOT recommended.
#
# This exports a streaming "rack.input" with lightweight concurrency.
# Applications are strongly advised to wrap all slow IO objects
# (sockets, pipes) using the Rainbows::Fiber::IO class whenever
# possible.
module Rainbows::FiberSpawn
  include Rainbows::Fiber::Base

  def worker_loop(worker) # :nodoc:
    init_worker_process(worker)
    Rainbows::Fiber::Base.setup(self.class, app)
    limit = worker_connections

    begin
      schedule do |l|
        break if Rainbows.cur >= limit
        io = l.kgio_tryaccept(Rainbows::Client) or next
        Fiber.new { process(io) }.resume
      end
    rescue => e
      Rainbows::Error.listen_loop(e)
    end while Rainbows.cur_alive
  end
end
debug log:

solving 3f0ec4a ...
found 3f0ec4a in http://bogomips.org/rainbows-public/20170402002615.GA32751@starla/
found 2c6d13d in http://bogomips.org/rainbows.git
preparing index
index prepared:
100644 2c6d13d3960aed47869dc65f23d4a3d1f9080472	lib/rainbows/fiber_spawn.rb

applying [1/1] http://bogomips.org/rainbows-public/20170402002615.GA32751@starla/
diff --git a/lib/rainbows/fiber_spawn.rb b/lib/rainbows/fiber_spawn.rb
index 2c6d13d..3f0ec4a 100644

Checking patch lib/rainbows/fiber_spawn.rb...
Applied patch lib/rainbows/fiber_spawn.rb cleanly.

index at:
100644 3f0ec4ae577deaff9306164bbbac2f148a0185d7	lib/rainbows/fiber_spawn.rb

Rainbows! Rack HTTP server user/dev discussion

Archives are clonable:
	git clone --mirror http://bogomips.org/rainbows-public
	git clone --mirror http://ou63pmih66umazou.onion/rainbows-public

Example config snippet for mirrors

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

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

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