5 The design is similar to the Evented Mongrel web server; except instead of
6 using EventMachine (a ruby binding to libevent), the Ebb web server is written
7 in C and uses the libev event loop library (http://software.schmorp.de/pkg/libev.html).
9 Connections are processed as follows:
11 1. libev loops and waits for incoming connections.
13 2. When Ebb can read from a client socket, it passes the buffer into the
14 mongrel state machine which parses the headers into name value pairs.
16 3. Ebb starts a new thread and passes the request information and peer socket
17 to a user supplied callback. The thread lasts only for the length of that
20 4. The included Ruby binding, supplying this callback transforms the request
21 into a Rack compatible "env" variable and passes it on a Rack adapter.
23 Because Ebb is written entirely in C, other language bindings can be added to
24 make it useful to Non-Ruby frameworks. For example a Python WSGI interface is
27 Ebb aims to be the smallest and fastest web server possible specifically for
28 doing the processing for web frameworks like Rails.
30 It's less than 1000 lines of C code!
31 wc -l ebb.c ebb.h tcp.c tcp.h ruby_binding/ebb_ext.c
35 * Bug fixing, unit testing, solidifying.
36 * Fix Ruby looping problem (see ruby_binding/ebb.rb:22)
38 * Statically allocate all request objects at compile-time in both TCP and Ebb.
39 * >> TCP writer callback <<
43 Copyright (c) 2007 Ryan Dahl
45 Permission is hereby granted, free of charge, to any person obtaining
46 a copy of this software and associated documentation files (the
47 "Software"), to deal in the Software without restriction, including
48 without limitation the rights to use, copy, modify, merge, publish,
49 distribute, sublicense, and/or sell copies of the Software, and to
50 permit persons to whom the Software is furnished to do so, subject to
51 the following conditions:
53 The above copyright notice and this permission notice shall be
54 included in all copies or substantial portions of the Software.
56 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
57 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
58 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
59 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
60 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
61 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
62 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.