Created
April 18, 2012 21:40
-
-
Save arturaz/2416786 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def checkin(conn) | |
synchronize do | |
conn.run_callbacks :checkin do | |
conn.expire | |
@queue.signal | |
end | |
release conn | |
end | |
end | |
private | |
def release(conn) | |
thread_id = nil | |
if @reserved_connections[current_connection_id] == conn | |
thread_id = current_connection_id | |
else | |
thread_id = @reserved_connections.keys.find { |k| # BOOM GOES HERE | |
@reserved_connections[k] == conn | |
} | |
end | |
@reserved_connections.delete thread_id if thread_id | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment