Fork Passenger, Unicorn Evented Thin, Goliath Implementation GIL Fiber Thread MRI 1.8 Y N Green MRI 1.9 Y Y OS jRuby N Slow Java Threads Rubinius 1.x Y N Green, OS Rubinius 2.0 N Y OS Saturday, December 8, 12
programs that can use the network to communicate with other processes. It does provide an alternate technique for those applications requiring better performance, scalability, and discipline over the behavior of network sockets, than is easily obtainable using the built-in libraries, especia$y in applications which are structura$y we$-suited for the event-driven programming model. Saturday, December 8, 12
'/', Index post '/login', Login get '/overview', Overview not_found() do run Proc.new{ [200, {'Content-Type' => 'text/plain'}, "Hi. Welcome to API. "] } end end Saturday, December 8, 12
=> 'change me' use Warden::Manager do |manager| manager.default_strategies :password manager.failure_app = Proc.new { |env| [401, {}, 'Access Denied'] } end use Authenticator end Saturday, December 8, 12
end end class Channel< Goliath::API def response EM.channel.start do end end end class Timer< Goliath::API def response EventMachine::PeriodicTimer(10){ loop_work() } end end class Queue< Goliath::API def response queue = EventMachine::Queue.new end end Saturday, December 8, 12
mysql2 Use better performance gems : sequel, erubis Database is next bottleneck, have one Nosql for your unimportant data ( feeds, likes ) Use Proc & Block with EM.defer or Thread Use em-http with your Network request Saturday, December 8, 12