Class: Asap::Netty::PipelineFactory
- Inherits:
-
Object
- Object
- Asap::Netty::PipelineFactory
- Defined in:
- lib/asap/netty/pipeline_factory.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
readonly
Returns the value of attribute callback.
Instance Method Summary collapse
- #get_pipeline ⇒ Object
-
#initialize(callback) ⇒ PipelineFactory
constructor
A new instance of PipelineFactory.
Constructor Details
#initialize(callback) ⇒ PipelineFactory
Returns a new instance of PipelineFactory.
8 9 10 |
# File 'lib/asap/netty/pipeline_factory.rb', line 8 def initialize(callback) @callback = callback end |
Instance Attribute Details
#callback ⇒ Object (readonly)
Returns the value of attribute callback.
6 7 8 |
# File 'lib/asap/netty/pipeline_factory.rb', line 6 def callback @callback end |
Instance Method Details
#get_pipeline ⇒ Object
12 13 14 15 16 17 |
# File 'lib/asap/netty/pipeline_factory.rb', line 12 def get_pipeline org.jboss.netty.channel.Channels.pipeline.tap do |pipeline| pipeline.add_last("codec", org.jboss.netty.handler.codec.http.HttpClientCodec.new) pipeline.add_last("handler", Asap::Netty::HttpResponseHandler.new(callback)) end end |