在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:postrank-labs/goliath开源软件地址:https://github.com/postrank-labs/goliath开源编程语言:Ruby 100.0%开源软件介绍:GoliathGoliath is an open source version of the non-blocking (asynchronous) Ruby web server framework. It is a lightweight framework designed to meet the following goals: bare metal performance, Rack API and middleware support, simple configuration, fully asynchronous processing, and readable and maintainable code (read: no callbacks). The framework is powered by an EventMachine reactor, a high-performance HTTP parser and Ruby 1.9+ runtime. 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, which leads to more maintainable and readable code. Each HTTP request within Goliath is executed within 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. Both request processing and response processing can be done in fully asynchronous fashion: streaming uploads, firehose API's, request/response, websockets, and so on. Installation & Prerequisites
$> gem install rvm
$> rvm install 1.9.3
$> rvm use 1.9.3
$> gem install goliath Getting Started: Hello Worldrequire 'goliath'
class Hello < Goliath::API
def response(env)
[200, {}, "Hello World"]
end
end
> ruby hello.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. See examples directory for more hands-on examples of building Goliath powered web-services. Performance: MRI, JRuby, RubiniusGoliath is not tied to a single Ruby runtime - it is able to run on MRI Ruby, JRuby and Rubinius today. Depending on which platform you are working with, you will see different performance characteristics. At the moment, we recommend MRI Ruby 1.9.3+ as the best performing VM: a roundtrip through the full Goliath stack on MRI 1.9.3 takes ~0.33ms (~3000 req/s). Goliath has been used in production environments for 2+ years, across many different companies: PostRank (now Google), OMGPOP (now Zynga), GameSpy, and many others. FAQ
GuidesHands-on applications:If you are you new to EventMachine, or want a detailed walk-through of building a Goliath powered API? You're in luck, a super-awesome Pluralsight screencast which will teach you all you need to know:
Additionally, you can also watch this presentation from GoGaRuCo 2011, which describes the design and motivation behind Goliath: Other resources: Discussion and SupportLicense & AcknowledgmentsGoliath is distributed under the MIT license, for full details please see the LICENSE file. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论