class_docstr: A thread-safe task queue with duplicate detection.
  
  The life-cycle of a task starts with producers calling `enqueue`. Consumers
  call `dequeue` to obtain the tasks in FIFO order. When processing is complete,
  consumers must release the tasks by calling `task_done`.
class_docstr_tok: ["A","thread-safe","task","queue","with","duplicate","detection",".","The","life-cycle","of","a","task","starts","with","producers","calling","`","enqueue","`",".","Consumers","call","`","dequeue","`","to","obtain","the","tasks","in","FIFO","order",".","When","processing","is","complete",",","consumers","must","release","the","tasks","by","calling","`","task_done","`","."]
code: def __init__(self):
      self._lock = threading.Lock()
      self._task_ids = set()
      # Note: the TaskQueue implementation relies on the queue being unbounded.
      # This must not change without revising the implementation.
      self._queue = queue.Queue()
      self._pending_tasks_by_id = {}
  
file_path: tfx/tfx/orchestration/experimental/core/task_queue.py
imports: import queue
  import threading
  from typing import Optional
  from tfx.orchestration.experimental.core import task
label_desc: Use image node_id 1 to create a new TaskQueue object  with example: obj = TaskQueue()