Class: Thrift::Processor::BinaryProcessor
- Inherits:
-
BaseProcessor
- Object
- BaseProcessor
- Thrift::Processor::BinaryProcessor
- Defined in:
- lib/thrift/processor.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(name, info, middleware, handler) ⇒ BinaryProcessor
constructor
A new instance of BinaryProcessor.
- #process(seqid, iprot, oprot) ⇒ Object
Constructor Details
#initialize(name, info, middleware, handler) ⇒ BinaryProcessor
Returns a new instance of BinaryProcessor.
223 224 225 226 227 228 229 230 231 232 |
# File 'lib/thrift/processor.rb', line 223 def initialize(name, info, middleware, handler) @middleware = middleware @handler = handler @arg_keys = info[:args] @void_result = info[:void_result] @result_klass = info[:result_klass] @exceptions = info[:exceptions] super name, info[:args_klass] end |
Instance Method Details
#process(seqid, iprot, oprot) ⇒ Object
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/thrift/processor.rb', line 234 def process(seqid, iprot, oprot) res = @middleware.handle_binary(@name, read_args(iprot)) do |args| execute(args) end write_result(res, oprot, seqid) true rescue ApplicationException => e Processor.write_exception(e, oprot, @name, seqid) true rescue StandardError => e Processor.write_internal_error(e, oprot, @name, seqid) true end |