def listen_many(*rooms):
rooms = set(r.conn for r in rooms)<EOL>for room in rooms:<EOL><INDENT>room.validate_listeners()<EOL><DEDENT>with ARBITRATOR.condition:<EOL><INDENT>while any(r.connected for r in rooms):<EOL><INDENT>ARBITRATOR.condition.wait()<EOL>rooms = [r for r in rooms if r.run_queues()]<EOL>if not rooms:<EOL><INDENT>return<EOL><DEDENT><DEDENT><DEDENT>
Listen for changes in all registered listeners in all specified rooms