Skip to content

Instantly share code, notes, and snippets.

@robdbirch
Last active August 29, 2015 14:18
Show Gist options
  • Save robdbirch/a47d48876d1ede195152 to your computer and use it in GitHub Desktop.
Save robdbirch/a47d48876d1ede195152 to your computer and use it in GitHub Desktop.
Ruby Thrift Code
# 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