Sha256: ca6be61921eef2fe7d2982e56cf9c7e76449c99aa5062f61ae59a0c4fa081c76

Contents?: true

Size: 664 Bytes

Versions: 9

Compression:

Stored size: 664 Bytes

Contents

require 'bundler/setup'
require 'reel'

class MyConnectionHandler
  include Celluloid

  def handle_connection(connection)
    connection.each_request { |req| handle_request(req) }
  rescue Reel::SocketError
    connection.close
  end

  def handle_request(request)
    request.respond :ok, ''
  end
end

connectionPool = MyConnectionHandler.pool

Reel::Server::HTTP.run('127.0.0.1', 3000) do |connection|
  # We're handing this connection off to another actor, so
  # we detach it first before handing it off
  connection.detach

  # Let a Connection Pool handle the connections for Roflscale Applications
  connectionPool.async.handle_connection(connection)
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
reel-0.6.1 benchmarks/reel_pool.rb
reel-0.6.0 benchmarks/reel_pool.rb
reel-0.6.0.pre5 benchmarks/reel_pool.rb
reel-0.6.0.pre4 benchmarks/reel_pool.rb
reel-0.6.0.pre3 benchmarks/reel_pool.rb
reel-0.6.0.pre2 benchmarks/reel_pool.rb
reel-0.6.0.pre1 benchmarks/reel_pool.rb
reel-0.5.0 benchmarks/reel_pool.rb
reel-0.5.0.pre benchmarks/reel_pool.rb