def METHOD_NAME(settings, **kwargs):
    consumer = session_ingest_consumer(settings, **kwargs)
    def waiter(exit_predicate, max_time=MAX_SECONDS_WAITING_FOR_EVENT):
        """
        Implements a wait loop for the ingest consumer
        :param exit_predicate:  A Callable[(),Any] that will be called in a loop after each call
            to the KafkaConsumer _run_once()
        :param max_time: maximum time in seconds to wait
        :return: the first non None result returned by the exit predicate or None if the
            max time has expired without the exit predicate returning a non None value
        """
        start_wait = time.time()
        with task_runner():
            while time.time() - start_wait < max_time:
                consumer._run_once()
                # check if the condition is satisfied
                val = exit_predicate()
                if val is not None:
                    return val  # we got what we were waiting for stop looping
        _log.warning(
            "Ingest consumer waiter timed-out after %d seconds", time.time() - start_wait
        )
        return None  # timeout without any success
    return waiter