(self, obj: Union[Dict, List[Dict]], gather_obj: bool = False)
| 73 | self._write_buffer(''.join(obj_list)) |
| 74 | |
| 75 | def append(self, obj: Union[Dict, List[Dict]], gather_obj: bool = False): |
| 76 | if self.enable_async: |
| 77 | if self._thread is None: |
| 78 | self._thread = Thread(target=self._append_worker, daemon=True) |
| 79 | self._thread.start() |
| 80 | self._queue.put({'obj': obj, 'gather_obj': gather_obj}) |
| 81 | else: |
| 82 | self._append(obj, gather_obj=gather_obj) |
| 83 | |
| 84 | def _write_buffer(self, text: str): |
| 85 | if not text: |