Class: Foxbat::WebPipeline

Inherits:
Object
  • Object
show all
Includes:
ChannelPipelineFactory
Defined in:
lib/foxbat/http_server.rb

Constant Summary collapse

HANDLER =
"handler"
ENCODER =
"encoder"
DECODER =
"decoder"
DEFLATER =
"deflater"

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ WebPipeline

Returns a new instance of WebPipeline.



24
25
26
27
# File 'lib/foxbat/http_server.rb', line 24

def initialize(app)
  @app = app
  @handler = ReadTimeoutHandler.new(EM.timer, 10)
end

Instance Method Details

#getPipelineObject



29
30
31
32
33
34
35
36
# File 'lib/foxbat/http_server.rb', line 29

def getPipeline
  pipeline = Channels.pipeline
  pipeline.addLast(DECODER, HttpRequestDecoder.new)
  pipeline.addLast(ENCODER, HttpResponseEncoder.new)
  pipeline.addLast(DEFLATER, HttpContentCompressor.new)
  pipeline.addLast(HANDLER, WebHandler.new(@app))
  pipeline
end