Class: Thrift::Processor::BidiStreamProcessor
- Inherits:
-
BaseStreamProcessor
- Object
- BaseProcessor
- BinaryProcessor
- BaseStreamProcessor
- Thrift::Processor::BidiStreamProcessor
- Defined in:
- lib/thrift/processor.rb
Instance Method Summary collapse
-
#initialize(name, info, middleware, handler) ⇒ BidiStreamProcessor
constructor
A new instance of BidiStreamProcessor.
- #process(seqid, iprot, oprot) ⇒ Object
Constructor Details
#initialize(name, info, middleware, handler) ⇒ BidiStreamProcessor
Returns a new instance of BidiStreamProcessor.
361 362 363 364 365 366 |
# File 'lib/thrift/processor.rb', line 361 def initialize(name, info, middleware, handler) @sink_klass = info[:sink_klass] @stream_klass = info[:stream_klass] super name, info, middleware, handler end |
Instance Method Details
#process(seqid, iprot, oprot) ⇒ Object
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
# File 'lib/thrift/processor.rb', line 368 def process(seqid, iprot, oprot) @closed = false bidi_stream = TBidiStream.new( iprot, oprot, @name, seqid, @sink_klass, @stream_klass, MessageTypes::CLIENT_STREAM_MESSAGE, MessageTypes::SERVER_STREAM_MESSAGE, method(:close) ) res = @middleware.handle_bidi_stream( @name, read_args(iprot), TBidiInboundStream.new(bidi_stream), TBidiOutboundStream.new(bidi_stream) ) do |args, sink, stream| execute(args, stream, sink) end write_result(res, oprot, seqid) bidi_stream.ready wait true end |