'Test multiple connections with pipelined requests.'

def test_multiple_connections(self):

    conns = [self.get_connection() for i in range(5)]
    events = [Event() for i in range(5)]
    query = 'SELECT    keyspace_name    FROM    system.schema_keyspaces    LIMIT    1'
    def cb(event, conn, count, *args, **kwargs):
        count += 1
        if (count >= 10):
            conn.close()
            event.set()
        else:
            conn.send_msg(QueryMessage(query=query, consistency_level=ConsistencyLevel.ONE), request_id=count, cb=partial(cb, event, conn, count))
    for (event, conn) in zip(events, conns):
        conn.send_msg(QueryMessage(query=query, consistency_level=ConsistencyLevel.ONE), request_id=0, cb=partial(cb, event, conn, 0))
    for event in events:
        event.wait()
