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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
| | = Zbatery: Rack HTTP server without a fork stuck in it
Zbatery is an HTTP server for Rack applications on systems that either
do not support fork(), or have no memory (nor need) to run the
master/worker model. It is based on Rainbows! (which is based on
Unicorn (which is based on Mongrel)) and inherits parts of each.
Zbatery supports your choice of all the thread/fiber/event/actor-based
concurrency models and Rack middleware that Rainbows! supports (or will
ever support) in a single process.
If you're on GNU/Linux and overwhelmed by options in zbatery,
consider {yahns}[http://yahns.yhbt.net/] as it has fewer options,
optional fork usage, and more energy-efficient during non-peak traffic.
Zbatery will still exploit certain features of Unix for transparent
upgrades, log reopening, and graceful stops, but does not rely on them
for basic functionality.
== Features
* Designed for {Rack}[http://rack.github.io/], the standard for
modern Ruby HTTP applications.
* Configuration files are compatible with Rainbows!, a superset
of the Unicorn
{DSL}[http://unicorn.bogomips.org/Unicorn/Configurator.html].
* Inherits all features and concurrency models Rainbows! supports
(and ever will support): http://rainbows.bogomips.org/Summary.html
* Web Sockets support (via {Cramp}[http://cramp.in/])
== License
\Zbatery is copyright 2009,2010,2011 by all contributors (see logs in git).
\Zbatery is licensed under the Ruby (1.8) license or the GPL (v2 or v3).
See the included {LICENSE}[link:LICENSE.html] file for more details.
\Zbatery is 100% Free Software.
== Install
You may install it via RubyGems on RubyGems.org:
gem install zbatery
Zbatery depends on Rainbows!, and in turn, Unicorn. Despite Unicorn and
Rainbows! being Unix-only, the Unicorn HTTP parser C extension should
build on non-Unix-like systems (unverified).
== Usage
=== for Rack applications
In APP_ROOT (where config.ru is located), run:
zbatery
Zbatery will bind to all interfaces on TCP port 8080 by default.
=== Configuration File(s)
Zbatery will look for the config.ru file used by rackup in APP_ROOT.
For deployments, it can use a config file for Unicorn and
Rainbows!-specific options specified by the +--config-file/-c+
command-line switch. Zbatery accepts all options found in
{Unicorn::Configurator}[http://unicorn.bogomips.org/Unicorn/Configurator.html]
as well as the "Rainbows!" block, so you can have the following in your
config file:
Rainbows! do
use :ThreadSpawn
worker_connections 666
end
See the Rainbows! configuration
{documentation}[http://rainbows.bogomips.org/Rainbows/Configurator.html]
for more details.
== Disclaimer
There is NO WARRANTY whatsoever if anything goes wrong, but let us know
and we'll try our best to fix it.
== Development
Most of the work is done in Rainbows!, Zbatery is just a shim to
allow access to Rainbows! without requiring fork() or signals.
You can get the latest source via git from the following locations:
git://bogomips.org/zbatery.git
git://repo.or.cz/zbatery.git (mirror)
You may browse the code from the web and download the latest snapshot
tarballs here:
* http://bogomips.org/zbatery.git (cgit)
* http://repo.or.cz/w/zbatery.git (gitweb)
Inline patches (from "git format-patch") to the mailing list are
preferred because they allow code review and comments in the reply to
the patch.
We will adhere to mostly the same conventions for patch submissions as
git itself. See the Documentation/SubmittingPatches document
distributed with git on on patch submission guidelines to follow. Just
don't email the git mailing list or maintainer with Zbatery patches.
== Tests
There currently are no tests specific to Zbatery. Keep in mind that
Zbatery is only a small shim to drive Rainbows! (and Unicorn)
underneath. Rainbows! and Unicorn both have extensive (but very
UNIX-specific) test suites.
== Contact
All feedback (bug reports, user/development discussion, patches, pull
requests) go to the mailing list/public-inbox. We are currently
borrowing the Rainbows! mailing list since most of our code (and
problems) are related to Rainbows! mailto:rainbows-public@bogomips.org.
|