forked from ohler55/agoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
5,730 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
os: | ||
- linux | ||
- osx | ||
|
||
sudo: false | ||
env: | ||
global: | ||
- MAKE="make -j 2" | ||
|
||
language: ruby | ||
rvm: | ||
- 2.4.2 | ||
- 2.5.0 | ||
- ruby-head | ||
|
||
script: | ||
- ./test/tests.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# CHANGELOG | ||
|
||
### 0.9.0 - 2018-01-28 | ||
|
||
Initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "https://rubygems.org" | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,61 @@ | ||
# hayai | ||
An HTTP Server for Ruby | ||
# agoo | ||
|
||
[](http://travis-ci.org/ohler55/agoo?branch=master) | ||
|
||
A High Performance HTTP Server for Ruby | ||
|
||
## Usage | ||
|
||
```ruby | ||
require 'agoo' | ||
|
||
server = Agoo::Server.new(6464, 'root') | ||
|
||
class MyHandler | ||
def initialize | ||
end | ||
|
||
def call(req) | ||
[ 200, { }, [ "hello world" ] ] | ||
end | ||
end | ||
|
||
handler = TellMeHandler.new | ||
server.handle(:GET, "/hello", handler) | ||
server.start() | ||
``` | ||
|
||
## Installation | ||
``` | ||
gem install agoo | ||
``` | ||
|
||
## What Is This? | ||
|
||
Agoo is Japanese for a type of flying fish. This gem flies. It is a high | ||
performance HTTP server that serves static resource at hundreds of thousands | ||
of fetchs per second. A a simple hello world Ruby handler at over 100,000 | ||
requests per second on a desktop computer. That places Agoo at about 80 times | ||
faster than Sinatra and 1000 times faster than Rails. In both cases the | ||
latency was an order of magnitude lower or more. Checkout the benchmarks on <a | ||
href="http://opo.technology/benchmarks.html#web_benchmarks">OpO | ||
benchmarks</a>. Note that the benchmarks had to use a C program called _hose_ | ||
from the <a href="http://opo.technology/index.html">OpO</a> downloads to hit | ||
the Agoo limits. Ruby benchmarks driver could not push Agoo hard enough. | ||
|
||
Agoo supports the [Ruby rack API](https://rack.github.io) which allows for the | ||
use of rack compatible gems. | ||
|
||
## Releases | ||
|
||
See [{file:CHANGELOG.md}](CHANGELOG.md) | ||
|
||
## Links | ||
|
||
- *Documentation*: http://rubydoc.info/gems/agoo | ||
|
||
- *GitHub* *repo*: https://github.com/ohler55/agoo | ||
|
||
- *RubyGems* *repo*: https://rubygems.org/gems/agoo | ||
|
||
Follow [@peterohler on Twitter](http://twitter.com/#!/peterohler) for announcements and news about the Agoo gem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
require 'date' | ||
require File.join(File.dirname(__FILE__), 'lib/agoo/version') | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "agoo" | ||
s.version = Agoo::VERSION | ||
s.authors = "Peter Ohler" | ||
s.date = Date.today.to_s | ||
s.email = "[email protected]" | ||
s.homepage = "http://www.ohler.com/agoo" | ||
s.summary = "An HTTP server" | ||
s.description = "A fast HTTP server supporting rack." | ||
s.licenses = ['MIT'] | ||
s.required_ruby_version = ">= 2.0" | ||
|
||
s.files = Dir["{lib,ext,test}/**/*.{rb,h,c}"] + ['LICENSE', 'README.md'] | ||
s.test_files = Dir["test/**/*.rb"] | ||
s.extensions = ["ext/agoo/extconf.rb"] | ||
|
||
s.has_rdoc = true | ||
s.extra_rdoc_files = ['README.md'] + Dir["pages/*.md"] | ||
s.rdoc_options = ['-t', 'Agoo', '-m', 'README.md', '-x', 'test/*'] | ||
|
||
s.rubyforge_project = 'agoo' | ||
|
||
s.add_development_dependency 'rake-compiler', '>= 0.9', '< 2.0' | ||
s.add_development_dependency 'minitest', '~> 5' | ||
s.add_development_dependency 'test-unit', '~> 3.0' | ||
s.add_development_dependency 'wwtd', '~> 0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) 2018, Peter Ohler, All rights reserved. | ||
|
||
#include <stdio.h> | ||
#include <ruby.h> | ||
|
||
#include "error_stream.h" | ||
#include "request.h" | ||
#include "response.h" | ||
#include "server.h" | ||
|
||
void | ||
Init_agoo() { | ||
VALUE mod = rb_define_module("Agoo"); | ||
|
||
error_stream_init(mod); | ||
request_init(mod); | ||
response_init(mod); | ||
server_init(mod); | ||
} |
Oops, something went wrong.