about summary refs log tree commit homepage
path: root/lib/rainbows/fiber/base.rb
DateCommit message (Collapse)
2011-05-10configurator: move validation logic over
There's actually no reason we can't have these methods in Rainbows::Configurator where it's easier to document nowadays.
2011-02-06minimize &block usage for yield
No need to allocate a proc every time when we can just yield much more efficiently.
2011-01-06eliminate G constant and just use the Rainbows! module
Code organization is hard :<
2011-01-04globally refactor Range handling for responses
Rack::Utils::HeaderHash is still very expensive in Rack 1.2, especially for simple things that we want to run as fast as possible with minimal interference. HeaderHash is unnecessary for most requests that do not send Content-Range in responses.
2010-12-27fiber/*: more efficient keepalive_timeout expiry
We can use the same interface as Rainbows::Fiber.sleep to avoid blindly waking up readers at ever scheduler invocation.
2010-12-27fiber/base: use bare "select" where possible
Less visual noise
2010-11-05avoid Errno::EAGAIN, harder
Errno::EAGAIN is still a problem under Ruby 1.9.2, so try harder to avoid it and use kgio methods. Even when 1.9.3 is available, kgio will still be faster as exceptions are slower than normal return values.
2010-10-22code shuffling for kgio
Despite the large number of changes, most of it is code movement here.
2010-07-10doc: avoid documenting internals on RDoc website
Since we suck at building websites, we just rely on RDoc as a website builder. And since Rainbows! is an application server (and not a programming library), our internal API should be of little interest to end users. Anybody interested in Rainbows! (or any other project) internals should be reading the source.
2010-07-04refactor response body handling for sendfile(2)
This hopefully allows the "sendfile" gem to be required anywhere in the Rainbows!/Unicorn config file, and not have to be required via RUBYOPT or the '-r' command-line switch. We also modularize HttpResponse and avoids singleton methods in the response path. This (hopefully) makes it easier for individual concurrency models to share code and override individual methods.
2010-06-28add preliminary sendfile (1.0.0) gem support
This still needs work and lots of cleanup, but the basics are there. The sendfile 1.0.0 RubyGem is now safe to use under MRI 1.8, and is superior to current (1.9.2-preview3) versions of IO.copy_stream for static files in that it supports more platforms and doesn't truncate large files on 32-bit platforms.
2010-06-28fiber/base: reuse process_client logic in base
This fleshes out Rainbows::Fiber::IO with a few more methods for people using it.
2010-06-28(style) prefer "until" instead of "while !"
2010-06-28base: constant/namespace cleanup
2010-06-18fiber/{base,io}: use arrays instead of hashes for r/w accounting
This gives a tiny performance improvement to the FiberSpawn and FiberPool concurrency models.
2010-06-18fiber/base: more accurate sleep timeout
Not that many people will actually call Rainbows.sleep outside of tests...
2010-06-18prefer Array#[] lookup to Array#first/Array#last
Array#[] lookups are slightly faster under both rbx and 1.9, and easier to read.
2010-03-28fiber/base: do not modify hash during iteration (1.9.2dev)
It's generally dangerous to do so regardless of language and Ruby 1.9.2dev is stricter about this sort of behaviour.
2010-02-26avoid leaks if app uses Rainbows::Fiber::IO
For the very rare apps out there using Rainbows::Fiber::IO, the FiberSpawn and FiberPool (but not RevFiberSpawn) models could leak memory if the app-created Rainbows::Fiber::IO objects were dereferenced without being removed from the RD/WR hashes.
2010-02-11use Hash#compare_by_identity for performance
When available (Ruby 1.9), we can use Hash#compare_by_identity to improve performance.
2009-12-22common Rainbows.sleep(nr) method
We'll export this across the board to all Rack applications to sleep with. This provides the optimum method of sleeping regardless of the concurrency model you choose. This method is still highly not recommended for pure event-driven models like Rev or EventMachine (but the threaded/fiber/actor-based variants are fine).
2009-12-16cleanup: consolidate write_nonblock error handling
2009-12-11env["hack.io"] for Fiber*, Revactor, Thread* models
This exposes a client IO object directly to the underlying application.
2009-11-26split Fiber::Base into its own file
While Revactor uses Fiber::Queue in AppPool, we don't want/need to expose the rest of our Fiber stuff to it since it can lead to lost Fibers if misused. This includes the Rainbows::Fiber.sleep method which only works inside Fiber{Spawn,Pool} models and the Rainbows::Fiber::IO wrapper class.