当前位置: 首页 > 软件库 > 大数据 > 数据查询 >

agoo

A High Performance HTTP Server for Ruby
授权协议 MIT License
开发语言 Java
所属分类 大数据、 数据查询
软件类型 开源软件
地区 不详
投 递 者 景星光
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Agoo

A High Performance HTTP Server for Ruby

Usage

Rack

require 'agoo'

Agoo::Server.init(6464, 'root')

class MyHandler
  def call(req)
    [ 200, { }, [ "hello world" ] ]
  end
end

handler = MyHandler.new
Agoo::Server.handle(:GET, "/hello", handler)
Agoo::Server.start()

# To run this example type the following then go to a browser and enter a URL
# of localhost:6464/hello.
#
# ruby hello.rb

GraphQL

require 'agoo'

class Query
  def hello
    'hello'
  end
end

class Schema
  attr_reader :query

  def initialize
    @query = Query.new()
  end
end

Agoo::Server.init(6464, 'root', thread_count: 1, graphql: '/graphql')
Agoo::Server.start()
Agoo::GraphQL.schema(Schema.new) {
  Agoo::GraphQL.load(%^type Query { hello: String }^)
}
sleep

# To run this GraphQL example type the following then go to a browser and enter
# a URL of localhost:6464/graphql?query={hello}
#
# ruby hello.rb

Installation

gem install agoo

Using agoo as server for rails

As agoo supports rack compatible apps you can use it for rails applications:

Add agoo to the Gemfile:

# Gemfile
gem 'agoo'

Install bundle:

$ bundle install

Start rails with agoo as server:

$ rails server -u agoo

Enjoy the increased performance!

What Is This?

Agoo is Japanese for a type of flying fish. This gem flies. It is a highperformance HTTP server that serves static resource at hundreds of thousandsof fetches per second. A simple hello world Ruby handler at over 100,000requests per second on a desktop computer. That places Agoo at about 85 timesfaster than Sinatra and 1000 times faster than Rails. In both cases thelatency was two orders of magnitude lower or more. Checkout thebenchmarks. Note thatthe benchmarks had to use a C program calledPerfer to hit the Agoo limits. Rubybenchmarks driver could not push Agoo hard enough.

Agoo supports the Ruby rack API which allows for theuse of rack compatible gems such as Hanami and Rails. Agoo also supports WebSockets and SSE.

Agoo is not available on Windows.

News

  • Version 2.11.0 supports GraphQL subscriptions. TLS (SSL,HTTPS)support added. Examples for both. Related, thegraphql-benchmarkrepo was given to the-benchmarker.

  • Agoo has a new GraphQL module with a simple, easy to useAPI. Checkout the hello orsong examples.An Instrumental Intro to GraphQL with Rubyis a walk through.

  • Agoo takes first place as the highest throughput on web-frameworksbenchmarks. Latency wasnot at the top but release 2.5.2 improves that. The Agoo-C benchmarks it atthe top. The fastest web server across all languages.

  • Clustered Agoo is ready. For slower application and a machine with multiplecores a significant improvement is performance is realized. The applicationmust be stateless in that no data is shared between workers.

  • WebSocket and SSE are supported and a PR has been submitted to updated theRack spec. Go over to the proposed Rackextension and give it a look and athumbs-up or heart if you like it.

  • Agoo now serves Rails static assets more than 8000 times faster than thedefault Puma. Thats right, 8000 times faster.

Releases

See file:CHANGELOG.md

Releases are made from the master branch. The default branch for checkout isthe develop branch. Pull requests should be made against the develop branch.

Support

Get supported Agoo with a Tidelift Subscription. Security updates are supported.

Links