Skip to content

Instantly share code, notes, and snippets.

@kovyrin
Created November 28, 2008 08:52
Show Gist options
  • Save kovyrin/29944 to your computer and use it in GitHub Desktop.
Save kovyrin/29944 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'thrift'
$:.push(File.dirname(__FILE__) + "/../src/gen-rb")
require 'FastQueue_constants'
require 'FastQueue'
# Talk to a server via TCP sockets, using a binary protocol
transport = Thrift::Socket.new("localhost", 9090)
transport.open()
protocol = Thrift::BinaryProtocol.new(transport)
# Create FastQueue client
puts "Connecting to the queue..."
queue = FastQueue::Client.new(protocol)
# Push some data
puts "Pushing some data..."
queue.push("test-qeue", "Hello, World!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment