Last active
August 29, 2015 14:18
-
-
Save robdbirch/a47d48876d1ede195152 to your computer and use it in GitHub Desktop.
Ruby Thrift Code
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
# Add to Gemfile | |
# gem 'thrift' | |
# gem 'storm' | |
require 'storm' | |
# Ruby DRPC Snippet of Code | |
class StormRunner | |
def submit_to_storm(service_name,data,host,port) | |
puts "Submitting to Storm" | |
transport = Thrift::FramedTransport.new(Thrift::Socket.new(host, port)) | |
protocol = Thrift::BinaryProtocol.new(transport) | |
client = Storm::DistributedRPC::Client.new(protocol) | |
transport.open() | |
return client.execute(service_name,data) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment