def reader_test(topics, cons, messages, on_message, wait_on_messages): reader = AsyncMessageReader( SERVICE, config_topics, value_type=TEXT, consistency=consistency) reader.on_message = on_message reader.open() write_messages(messages, topics) wait_on_messages() reader.close()
def consumer(service): reader = AsyncMessageReader(service) reader.on_message = show_message reader.open() wait_for_keyboard_interrupt() reader.close()