parameters: (self)
docstring: Continuously flush and close logging handlers.
docstring_summary: Continuously flush and close logging handlers.
docstring_tokens: Continuously flush and close logging handlers .
function: def run(self):
          """Continuously flush and close logging handlers."""
  
          try:
              while not (self.__should_stop.is_set() and self.__scheduler.empty()):
                  self.__scheduler.run()
  
                  # Reset 'self.__schedule_updated' here since we've processed all the events
                  # thought to exist. Either the queue won't be empty or 'self.__schedule_updated'
                  # will get set again later.
                  self.__schedule_updated.clear()
  
                  if self.__should_stop.is_set():
                      # If the main thread has asked the flush thread to stop, then either run
                      # whatever has been added to the queue since the scheduler last ran, or exit.
                      continue
  
                  # Otherwise, wait for a new event to be scheduled.
                  if self.__scheduler.empty():
                      self.__schedule_updated.wait()
          finally:
              self.__terminated.set()
function_tokens: def run ( self ) : try : while not ( self . __should_stop . is_set ( ) and self . __scheduler . empty ( ) ) : self . __scheduler . run ( ) # Reset 'self.__schedule_updated' here since we've processed all the events # thought to exist. Either the queue won't be empty or 'self.__schedule_updated' # will get set again later. self . __schedule_updated . clear ( ) if self . __should_stop . is_set ( ) : # If the main thread has asked the flush thread to stop, then either run # whatever has been added to the queue since the scheduler last ran, or exit. continue # Otherwise, wait for a new event to be scheduled. if self . __scheduler . empty ( ) : self . __schedule_updated . wait ( ) finally : self . __terminated . set ( )