ProductPromotion
Logo

Ruby

made by https://0x3d.site

GitHub - ohler55/agoo: A High Performance HTTP Server for Ruby
A High Performance HTTP Server for Ruby. Contribute to ohler55/agoo development by creating an account on GitHub.
Visit Site

GitHub - ohler55/agoo: A High Performance HTTP Server for Ruby

GitHub - ohler55/agoo: A High Performance HTTP Server for Ruby

{}j Agoo

Build Status Gem Version Gem TideLift

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 a 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 high performance HTTP server that serves static resource at hundreds of thousands of fetches per second. A simple hello world Ruby handler at over 100,000 requests per second on a desktop computer. That places Agoo at about 85 times faster than Sinatra and 1000 times faster than Rails. In both cases the latency was two orders of magnitude lower or more. Checkout the benchmarks.

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

Agoo is not available on Windows.

Getting Started

Some examples can be found in the example directory. Some other documented walk through examples of using Agoo are in the misc directory. These examples are described in markdown files. Some like the song example are simple while others like the glue are more complex. The documented walk through examples are:

  • flymd - realtime push
  • glue - publish and subscribe
  • optimize - optimizing static asset use
  • push - push with Rack
  • rails - faster rails
  • song - fun and simple GraphQL

News

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

  • Agoo has a new GraphQL module with a simple, easy to use API. Checkout the hello or song examples. An Instrumental Intro to GraphQL with Ruby is a walk through.

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

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

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

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

Releases

See file:CHANGELOG.md

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

Support

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

Links

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory