Created
May 24, 2011 20:32
-
-
Save btakita/989601 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe UserService do | |
attr_reader :client_iprot, :client_iprot_transport, :client_oprot, :client_oprot_transport, :server_iprot, :server_iprot_transport, :server_oprot, :server_oprot_transport, :client, :server_handler, :server_processor | |
before do | |
@client_iprot_transport = ::Thrift::MemoryBufferTransport.new | |
@client_iprot = ::Thrift::BinaryProtocol.new(client_iprot_transport) | |
@client_oprot_transport = ::Thrift::MemoryBufferTransport.new | |
@client_oprot = ::Thrift::BinaryProtocol.new(client_iprot_transport) | |
@client = UserService::Client.new(client_iprot, client_oprot) | |
@server_iprot_transport = ::Thrift::MemoryBufferTransport.new | |
@server_iprot = ::Thrift::BinaryProtocol.new(server_iprot_transport) | |
@server_oprot_transport = ::Thrift::MemoryBufferTransport.new | |
@server_oprot = ::Thrift::BinaryProtocol.new(server_oprot_transport) | |
@server_handler = UserHandler.new | |
@server_processor = TcUser::Thrift::UserService::Processor.new(server_handler) | |
stub.proxy(client).send_message do | |
server_iprot_transport.write client_iprot_transport.instance_variable_get(:@buf).dup | |
server_processor.process(server_iprot, server_oprot) | |
client_iprot_transport.reset_buffer server_oprot_transport.instance_variable_get(:@buf).dup | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment