(self, obj: Union[Dict, List[Dict]], gather_obj: bool = False)
| 83 | self._write_buffer("".join(obj_list)) |
| 84 | |
| 85 | def append(self, obj: Union[Dict, List[Dict]], gather_obj: bool = False): |
| 86 | if self.enable_async: |
| 87 | if self._thread is None: |
| 88 | self._thread = Thread(target=self._append_worker, daemon=True) |
| 89 | self._thread.start() |
| 90 | self._queue.put({"obj": obj, "gather_obj": gather_obj}) |
| 91 | else: |
| 92 | self._append(obj, gather_obj=gather_obj) |
| 93 | |
| 94 | def _write_buffer(self, text: str): |
| 95 | if not text: |