def METHOD_NAME(self) -> None:
    if len(self._buffer) == 0:
        logger.debug("no events to be processed in queue")
        return
    with self._buffer_lock:
        t0 = time.time()
        batch_of_events_for_processing, self._buffer = (
            self._buffer[: self._max_batch],
            self._buffer[self._max_batch :],
        )
        left_in_queue = len(self._buffer)
    function_to_events_map: Dict[
        Callable[[List[CloudEvent]], None], List[CloudEvent]
    ] = OrderedDict()
    for func, event in batch_of_events_for_processing:
        if func not in function_to_events_map:
            function_to_events_map[func] = []
        function_to_events_map[func].append(event)
    for func, events in function_to_events_map.items():
        func(events)
    logger.debug(
        f"processed {len(batch_of_events_for_processing)} events in "
        f"{(time.time()-t0):.6f}s. "
        f"{left_in_queue} left in queue"
    )