Class: WildSoNet::Streamer::PipelineFactory

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

Instance Method Summary collapse

Constructor Details

#initialize(encoder) ⇒ PipelineFactory

Returns a new instance of PipelineFactory.



71
72
73
# File 'lib/server.rb', line 71

def initialize encoder
  @encoder = encoder
end

Instance Method Details

#getPipelineObject



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/server.rb', line 75

def getPipeline

  pip = Channels.pipeline

  pip.addLast("framer", DelimiterBasedFrameDecoder.new(8192, Delimiters.lineDelimiter()))

  pip.addLast("decoder", StringDecoder.new)
  pip.addLast("encoder", StringEncoder.new)

  handler = Handler.new
  handler.encoder = @encoder

  pip.addLast("handler", handler)

  pip

end