0.0
No commit activity in last 3 years
No release in over 3 years
Really thin and non intuitive ruby server. Made to be fast and ready for really heavy servers (not only http server).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 3.0
 Project Readme

CrapServer

Gem Version Code Climate

Really thin and non intuitive ruby server. Made to be fast and ready for really heavy servers (not only http server). Use Preforking, Evented IO and a Thread Pool to handle each connection and prevent get stuck by some slow query.

Another one?

Yes. Why? because 2 main reasons. First, this is not a HTTP Web server, this is a generic server that can be used for any kind of TCP Socket server. Second and most important, because is funny :)

Installation

Add this line to your application's Gemfile:

gem 'crap_server'

And then execute:

$ bundle

Or install it yourself as:

$ gem install crap_server

Basic Usage

CrapServer::Application.run! do |data|
    if data =~ /^GET/
        write "Hello world"
    elsif data =~ /^SET/
        write "Setting value"
    else
        write "Something is wrong"
    end
end

See all available options in lib/crap_server/configure.rb

Pool size

By default, the pool size run 10 threads per core. You can change it with the pool_size config option.

Running our application

ruby my_app.rb

More info.

More info in the wiki of the gem.

Production ready?

No. Use it under your own risk. Right now, the interface can change.

Contributing

  1. Fork it ( https://github.com/anga/crap_server/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request