Skip to content

Instantly share code, notes, and snippets.

@kzk
Created April 29, 2010 13:12
Show Gist options
  • Save kzk/383574 to your computer and use it in GitHub Desktop.
Save kzk/383574 to your computer and use it in GitHub Desktop.
require 'rubygems'
gem 'msgpack'
gem 'msgpack-rpc'
require 'msgpack'
require 'msgpack/rpc'
port = 1985
cli = MessagePack::RPC::Client.new("127.0.0.1", port)
cli.timeout = 0.1
begin
p cli.call(:hello0)
p cli.call(:hello1, 1)
p cli.call(:hello2, 1, 2)
rescue MessagePack::RPC::TimeoutError
timeout = true
end
cli.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment