Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
76 lines (63 loc) · 3.08 KB
/
Copy pathindex.html
File metadata and controls
76 lines (63 loc) · 3.08 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Goliathb</title>
<link href="/stylesheets/screen.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<a href="http://github.com/postrank-labs/goliath"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
<div id="container">
<h1><a href="http://github.com/postrank-labs/goliath">Goliath</a>
<span class="small">by <a href="http://github.com/postrank-labs">postrank-labs</a></span></h1>
<div class="description">
<p>Goliath is an open source version of the non-blocking Ruby web server framework powering PostRank.
It is a lightweight framework designed to meet the following goals: bare metal performance,
Rack like API and middleware support, simple configuration, fully asynchronous processing,
and readable and maintainable code (read: no callbacks).</p>
<p>The framework is powered by an EventMachine reactor under the hood and Ryan Dahl's HTTP parser
(same as node.js). The one major advantage Goliath has over other asynchronous frameworks is
the fact that by leveraging Ruby Fibers introduced in Ruby 1.9+, it can untangle the complicated
callback-based code into a format we are all familiar and comfortable with: linear execution.</p>
<p>Each Goliath request is executed in its own Ruby Fiber and all asynchronous I/O operations can
transparently suspend and later resume the processing without requiring the developer to write
any additional code.</p>
<p>Goliath exposes a raw, bare-metal Rack-like API for developing high throughput web-services.
Both request processing and response processing can be done in fully asynchronous fashion:
streaming uploads, firehose API's, request/response, and so on.</p>
</div>
<h2>Installation & Prerequisites</h2>
<p>
<ul>
<li>Ruby 1.9.x +</li>
<li>gem install goliath</li>
</ul>
</p>
<h2>Getting Started</h2>
<pre><code>require 'goliath'
class Echo < Goliath::API
# reload code on every request in dev environment
use ::Rack::Reloader, 0 if Goliath.dev?
def response(env)
[200, {}, "Hello World"]
end
end
> ruby echo.rb -sv
> [97570:INFO] 2011-02-15 00:33:51 :: Starting server on 0.0.0.0:9000 in development mode. Watch out for stones.</code></pre>
<h2>Discussion and Support</h2>
<p>
<ul>
<li><a href="https://github.com/postrank-labs/goliath/issues">Issues</a></li>
<li><a href="http://groups.google.com/group/goliath-io">Mailing List</a></li>
</ul>
</p>
<h2>Contributing</h2>
<p>You can clone the project with <a href="http://git-scm.com">Git</a> by running:
<pre>$ git clone git://github.com/postrank-labs/goliath</pre>
</p>
<div class="footer">
© 2011 PostRank Inc.
</div>
</div>
</body>
</html>