class_docstr: Wrapper around `History` implementations that run the `load()` generator in
  a thread.
  
  Use this to increase the start-up time of prompt_toolkit applications.
  History entries are available as soon as they are loaded. We don't have to
  wait for everything to be loaded.
code: def __init__(self, history: History) -> None:
      super().__init__()
  
      self.history = history
  
      self._load_thread: threading.Thread | None = None
  
      # Lock for accessing/manipulating `_loaded_strings` and `_loaded`
      # together in a consistent state.
      self._lock = threading.Lock()
  
      # Events created by each `load()` call. Used to wait for new history
      # entries from the loader thread.
      self._string_load_events: list[threading.Event] = []
  
imports: from __future__ import annotations
  import datetime
  import os
  import threading
  from abc import ABCMeta, abstractmethod
  from asyncio import get_running_loop
  from typing import AsyncGenerator, Iterable, Sequence
label_desc: Use image node_id 1 to create a new ThreadedHistory object from inherited base classes: History with example: obj = ThreadedHistory(history)