'Process any pending kill cursors requests and
maintain connection pool parameters.'

def _process_periodic_tasks(self):

    address_to_cursor_ids = defaultdict(list)
    while True:
        try:
            (address, cursor_ids) = self.__kill_cursors_queue.pop()
        except IndexError:
            break
        address_to_cursor_ids[address].extend(cursor_ids)
    if address_to_cursor_ids:
        topology = self._get_topology()
        for (address, cursor_ids) in address_to_cursor_ids.items():
            try:
                self._kill_cursors(cursor_ids, address, topology)
            except Exception:
                helpers._handle_exception()
    try:
        self._topology.update_pool()
    except Exception:
        helpers._handle_exception()
