Skip to content

Instantly share code, notes, and snippets.

@vincentchu
Created November 14, 2011 19:15
Show Gist options
  • Save vincentchu/1364834 to your computer and use it in GitHub Desktop.
Save vincentchu/1364834 to your computer and use it in GitHub Desktop.
HandlerSocket + Ruby!

Build libhsclient libs

git clone https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL.git
cd HandlerSocket-Plugin-for-MySQL
./autogen.sh
./configure --disable-handlersocket-server
make
sudo make install

Build handlersocket ruby client

wget https://bitbucket.org/winebarrel/ruby-handlersocket/get/c19841e47ea2.tar.gz
tar -xvzf c19841e47ea2.tar.gz
cd winebarrel-ruby-handlersocket-c19841e47ea2/
cp -r ../HandlerSocket-Plugin-for-MySQL/libhsclient/ ./
ruby extconf.rb
make

Now you have access to HandlerSocket!

require 'handlersocket'
h = HandlerSocket.new('127.0.0.1', 9998)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment