Permalink
Browse files

fix readme formatting, grrr!

  • Loading branch information...
1 parent 9229938 commit 56c9971d9e7715317c178f995c067bd5d7fa87f6 @igrigorik committed Feb 16, 2010
Showing with 18 additions and 17 deletions.
  1. +18 −17 README.md
View
35 README.md
@@ -5,35 +5,36 @@ callbacks, errbacks and all other niceties of EventMachine while keeping the API
of the original MySQL gem. Simple, but it works.
Features:
-* Maintains mysql gem API
-* Deferrables for every query with callback & errback
-* Connection query queue - pile 'em up!
-* Auto-reconnect on disconnects
-* Auto-retry on deadlocks
+
+ * Maintains mysql gem API
+ * Deferrables for every query with callback & errback
+ * Connection query queue - pile 'em up!
+ * Auto-reconnect on disconnects
+ * Auto-retry on deadlocks
## Example usage:
- EventMachine.run {
+ EventMachine.run {
conn = EventMachine::MySQL.new(:host => 'localhost')
query = conn.query("select 1+1")
query.callback { |res| p res.all_hashes }
query.errback { |res| p res.all_hashes }
- }
+ }
## Query queueing:
- EventMachine.run {
- conn = EventMachine::MySQL.new(:host => 'localhost')
+ EventMachine.run {
+ conn = EventMachine::MySQL.new(:host => 'localhost')
- results = []
- conn.query("select 1") {|res| results.push res.fetch_row.first.to_i}
- conn.query("select 2") {|res| results.push res.fetch_row.first.to_i}
- conn.query("select 3") {|res| results.push res.fetch_row.first.to_i}
+ results = []
+ conn.query("select 1") {|res| results.push res.fetch_row.first.to_i}
+ conn.query("select 2") {|res| results.push res.fetch_row.first.to_i}
+ conn.query("select 3") {|res| results.push res.fetch_row.first.to_i}
- EventMachine.add_timer(0.05) {
- p results # => [1,2,3]
- }
- }
+ EventMachine.add_timer(0.05) {
+ p results # => [1,2,3]
+ }
+ }
# Credits

0 comments on commit 56c9971

Please sign in to comment.