Sha256: e03f0560162b5511f6ac423b18c2270d09ea30ba85b7099d36592bc8c7eb8b4e

Contents?: true

Size: 2 KB

Versions: 2

Compression:

Stored size: 2 KB

Contents

#
# Autogenerated by Thrift Compiler (2.0.1-upfluence)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#

require 'thrift'
require 'srv'
require 'debug_proto_test_types'

module Inherited
  SERVICE_NAME = "Inherited"
  PROGRAM_NAME = ""

  class Client < ::Srv::Client 
    include ::Thrift::Client

    def self.from_provider(provider)
      Client.new(*provider.build(", Inherited"))
    end

    def identity(ctx, arg)
      @middleware.handle_binary(ctx, 'identity', Identity_args.new(:arg => arg)) do |ctx, args|
        send_identity(ctx, args.arg)
        return recv_identity(ctx)
      end
    end

    def send_identity(ctx, arg)
      send_message('identity', Identity_args, :arg => arg)
    end

    def recv_identity(ctx)
      result = receive_message(Identity_result)
      return result.success unless result.success.nil?
      raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'identity failed: unknown result')
    end

  end

  class Processor < ::Srv::Processor 
    include ::Thrift::Processor

    def process_identity(ctx, seqid, iprot, oprot)
      args = read_args(iprot, Identity_args)
      @middleware.handle_binary(ctx, 'identity', args) do |ctx, args|
        result = Identity_result.new()
        result.success = @handler.identity(ctx, args.arg)
        write_result(result, oprot, 'identity', seqid)
      end
    end

  end

  # HELPER FUNCTIONS AND STRUCTURES

  class Identity_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    ARG = 1

    FIELDS = {
      ARG => {:type => ::Thrift::Types::I32, :name => 'arg'}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class Identity_result
    include ::Thrift::Struct, ::Thrift::Struct_Union
    SUCCESS = 0

    FIELDS = {
      SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
upfluence-thrift-2.1.1 test/debug_proto/gen-rb/inherited.rb
upfluence-thrift-1.1.0 test/debug_proto/gen-rb/inherited.rb