class Syntropy::ConnectionPool

def with_db

def with_db
  if (db = Thread.current[@key])
    @machine.snooze
    return yield(db)
  end
  db = checkout
  begin
    Thread.current[@key] = db
    yield(db)
  ensure
    Thread.current[@key] = nil
    checkin(db)
  end
end