Skip to content
Browse files

update README example

  • Loading branch information...
1 parent 87ff06e commit 4c7d32820bafc65c8aadda97f7cfe412c3dcd9e5 @igrigorik committed Jan 14, 2011
Showing with 17 additions and 13 deletions.
  1. +11 −7 README.md
  2. +2 −2 em-handlersocket.gemspec
  3. +1 −1 lib/em-handlersocket.rb
  4. +3 −3 lib/em-handlersocket/version.rb
View
18 README.md
@@ -1,8 +1,14 @@
# EM-HandlerSocket
-Experimental client for HandlerSocket MySQL plugin for direct read/write of InnoDB tables. This plugin bypasses any/all SQL parsing, query planner, and other locks, while giving you the advantage of InnoDB persistence, speed, and the network daemon!
+Experimental client for HandlerSocket MySQL plugin for direct read/write of InnoDB tables. This plugin bypasses any/all SQL parsing, query planner, and other MySQL locks, while giving you the advantage of InnoDB persistence, speed, and the network daemon!
-Best of all, HandlerSocket plugin runs alongside your regular InnoDB engine, which means you still have the full advantage of a SQL console at your disposal.
+Best of all, HandlerSocket plugin runs alongside your regular MySQL engine, which means you still have the full advantage of a SQL console at your disposal.
+
+## Features
+
+- Plays nicely with the (EventMachine) reactor
+- No native extensions
+- Pipelined processing
## Example: Open & Read from an InnoDB index
@@ -13,20 +19,18 @@ Open the PRIMARY key index on the widgets.user InnoDB table, and query for id ==
idx = {:id => 0, :db => 'widgets', :table => 'user', :index_name => 'PRIMARY', :columns => 'user_name'}
d = c.open_index(idx)
- d.callback do |s|
+ d.callback do
d = c.query(:id => 0, :op => '=', :key => '1')
+ d.errback { p 'uh oh!' }
d.callback do |data|
- data.last.should == 'Ilya'
- EM.stop
+ p ["received data", data]
end
end
}
## Todo
-- Add support for multi-query
-- Handlers for proper callback/errback logic
- Add support for insert/update/delete
## Resources
View
4 em-handlersocket.gemspec
@@ -4,12 +4,12 @@ require "em-handlersocket/version"
Gem::Specification.new do |s|
s.name = "em-handlersocket"
- s.version = Em::Handlersocket::VERSION
+ s.version = EventMachine::HandlerSocket::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Ilya Grigorik"]
s.email = ["ilya@igvita.com"]
s.homepage = "http://github.com/igrigorik/em-handlersocket"
- s.summary = "EventMachine HandlerSocket MySQL plugin for direct read/write of InnoDB tables"
+ s.summary = "Asynchronous (EventMachine) HandlerSocket client"
s.description = s.summary
s.rubyforge_project = "em-handlersocket"
View
2 lib/em-handlersocket.rb
@@ -13,4 +13,4 @@ def self.new(options = {})
EventMachine.connect(opt[:host], opt[:port], EventMachine::HandlerSocket::Client)
end
end
-end
+end
View
6 lib/em-handlersocket/version.rb
@@ -1,5 +1,5 @@
-module Em
- module Handlersocket
- VERSION = "0.0.1"
+module EventMachine
+ module HandlerSocket
+ VERSION = "0.1.0"
end
end

0 comments on commit 4c7d328

Please sign in to comment.
Something went wrong with that request. Please try again.