def processor():  
registry = get_current_registry()<EOL>settings = registry.settings<EOL>connection_string = settings[CONNECTION_STRING]<EOL>channels = _get_channels(settings)<EOL>with psycopg2.connect(connection_string) as conn:<EOL><INDENT>conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)<EOL>with conn.cursor() as cursor:<EOL><INDENT>for channel in channels:<EOL><INDENT>cursor.execute('<STR_LIT>'.format(channel))<EOL>logger.debug('<STR_LIT>'<EOL>.format(channel))<EOL><DEDENT><DEDENT>registry.notify(ChannelProcessingStartUpEvent())<EOL>rlist = [conn]  <EOL>wlist = []  <EOL>xlist = []  <EOL>timeout = <NUM_LIT:5><EOL>while True:<EOL><INDENT>if select.select(rlist, wlist, xlist, timeout) != ([], [], []):<EOL><INDENT>conn.poll()<EOL>while conn.notifies:<EOL><INDENT>notif = conn.notifies.pop(<NUM_LIT:0>)<EOL>logger.debug('<STR_LIT>'<EOL>.format(notif.pid, notif.channel,<EOL>notif.payload))<EOL>event = create_pg_notify_event(notif)<EOL>try:<EOL><INDENT>registry.notify(event)<EOL><DEDENT>except Exception:<EOL><INDENT>logger.exception('<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>
Churns over PostgreSQL notifications on configured channels.
    This requires the application be setup and the registry be available.
    This function uses the database connection string and a list of
    pre configured channels.