Date | Commit message (Collapse) |
|
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.
|
|
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.
|
|
While we're at it, fix a comment, too.
|
|
|
|
|
|
|
|
Array#[] lookups are slightly faster under both rbx and 1.9,
and easier to read.
|
|
IO#readpartial on zero bytes will always return an empty
string, so ensure the emulator for Revactor does that as
well.
|
|
WAvoid mucking with Unicorn::TeeInput, since other apps may
depend on that class, so we subclass it as Rainbows::TeeInput
and modify as necessary in worker processes.
For Revactor, remove the special-cased
Rainbows::Revactor::TeeInput class and instead emulate
readpartial for Revactor sockets instead.
|
|
Every concurrency model does this the same way.
This removes the Rainbows::Const::LOCALHOST constant and
may break some existing apps that rely on it.
|
|
No point in having extra code around for platforms we
don't care about.
|
|
instance_variable_{set,get} are faster, but equally ugly
|
|
|
|
|
|
This exposes a client IO object directly to the underlying
application.
|
|
We now correctly exit!(2) if our master can't kill us.
|
|
This model has basically been rewritten to avoid unbounded
memory growth (slow without keepalive) due to listeners
not properly handling :*_closed messages.
Performance is much more stable as a result, too.
|
|
Some people fork processes, so it avoid hanging a connection
open because of that...
|
|
Make sure app errors get logged correctly, and we no longer
return a 500 response when a client EOFs the write end (but not
the read end) of a connection.
|
|
And change the default to 2 seconds, most clients can
render the page and load all URLs within 2 seconds.
|
|
We'll be getting a keepalive_timeout setting soon,
clients with 300 second idle keepalives are ridiculous
and Ruby objects are still not that cheap in 1.9
|
|
Unicorn 0.94.0 got a more generic handle_error function
that's useful in the Thread* models. The Revactor one
is a little different but similar to be worth refactoring
to match our standard pieces.
|
|
It turns out neither the EventMachine and Rev classes
checked for master death in its heartbeat mechanism.
Since we managed to forget the same thing twice, we
now have a test case for it and also centralized the
code to remove duplication.
|
|
Also new are added basic HTTP tests for UNIX domain socket
handling (for all models, now, of course).
|
|
Like everybody else... Closing the listener sockets doesn't seem
to wakeup the actors reliably and since it's easier to use a 1
second heartbeat than correct signal/messaging for all the rest
of the other clients, we'll just do that instead of relying on
one-off signal handlers.
|
|
We use the "G" global constant from the Rev model everywhere
to simplify things a little.
Test cases are more consistent now, too.
|
|
|
|
|
|
Avoid overloading the "alive" variable here and wakeup less
frequently as well to do the fchmod.
|
|
We'll finish processing the current request and
set the "Connection: close" header if possible.
|
|
|
|
Once our listeners get closed, we're as good as
dead so we should exit to avoid spinning.
|
|
This can be common across everything
|
|
It'll be easier to maintain a common language for logging
and debugging.
|
|
This is for compatibility with OpenBSD as reported
by Jeremy Evans for Unicorn.
|
|
|
|
It's usually a bad sign if we have unhandled exceptions in
the listener loops, so we'll exit just in case.
|
|
While we're at it, make it properly 100% message-driven so
there's no more busy-waiting and polling for dead actors, No we
just wait for client actors to die off and resume listener
actors if they stopped accepting.
|
|
Revactor may be gaining support for UNIX domain socket listeners
soon, so factor out revactorize_listeners into its own method
that can conditionally handle UNIX domain sockets if our
Revactor version supports it.
Patch for Revactor submitted here:
http://rubyforge.org/pipermail/revactor-talk/2009-October/000035.html
|
|
They're similar enough (especially as far as the constants go)
and allows a :Base to be used which basically acts like plain
Unicorn but with HTTP keepalive + pipelining support
|
|
Patch submitted upstream:
http://rubyforge.org/pipermail/revactor-talk/2009-October/000034.html
|
|
|
|
No tests yet, but the old "gossamer" and "rainbows" branches
seem to be basically working.
|