class_docstr: Execute a subcommand on another thread.
  
  Thread that launches a process and then streams its output back to the main
  command. We use threads to avoid using select() and raw filehandles, and the
  complex logic that brings doing line buffering.
class_docstr_tok: ["Execute","a","subcommand","on","another","thread",".","Thread","that","launches","a","process","and","then","streams","its","output","back","to","the","main","command",".","We","use","threads","to","avoid","using","select","(",")","and","raw","filehandles",",","and","the","complex","logic","that","brings","doing","line","buffering","."]
code: def __init__(
      self, parent, name: str, command: list[str], env: dict[str, str]
  ):
      super().__init__()
      self.parent = parent
      self.name = name
      self.command = command
      self.env = env
  
imports: from __future__ import annotations
  import logging
  import os
  import socket
  import subprocess
  import threading
  import time
  from collections import deque
  from typing import TYPE_CHECKING
  from termcolor import colored
  from airflow.configuration import conf
  from airflow.executors import executor_constants
  from airflow.executors.executor_loader import ExecutorLoader
  from airflow.jobs.job import most_recent_job
  from airflow.jobs.scheduler_job_runner import SchedulerJobRunner
  from airflow.jobs.triggerer_job_runner import TriggererJobRunner
  from airflow.utils import db
  from airflow.utils.providers_configuration_loader import providers_configuration_loaded
label_desc: Use image node_id 1 to create a new SubCommand object from inherited base classes: threading with example: obj = SubCommand(parent, name, command, env)