Skip to content

Commit b23c19a

Browse files
committed
Document ssynchronous abilities
1 parent 1911499 commit b23c19a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.textile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,27 @@ Without GC 0.040000 0.010000 0.050000 ( 0.311233)
130130
</code>
131131
</pre>
132132

133+
h2. Asynchronous abilities
134+
135+
The adapter exposes Mysqplus's async interface through the connection instance.
136+
<pre>
137+
<code>
138+
MysqlUser.connection.send_query( "SELECT * FROM mysql.user WHERE User = 'root'" ) # Returns right away, no IO wait
139+
MysqlUser.connection.get_result # Retrieves the result from the previous async query
140+
</code>
141+
</pre>
142+
143+
Be very careful with this feature :
144+
<pre>
145+
<code>
146+
Model.connection.send_query( "first query" )
147+
Model.connection.send_query( "second query" )
148+
Model.connection.get_result # Resultset of "second query"
149+
</code>
150+
</pre>
151+
152+
Abuse may also lead to server side temporary tables not being properly cleaned up, although this effect is partially negated by the Connection Pool's check in / check out feature which switches the current mysql user session back to itself, cleaning up in the process.This holds true for the request / response cycle, but doesn't apply to background processes etc.
153+
133154
h2. Stability
134155

135156
In (pre)-production use at a handful of sites and the test suite is designed to run against the existing ActiveRecord suite.

0 commit comments

Comments
 (0)