Buckets:
MisterAI/LocalAI_Demo_backends / cpu-diffusers.upgrade-tmp /venv /lib /python3.10 /site-packages /ipykernel /thread.py
| """Base class for threads.""" | |
| from threading import Thread | |
| from tornado.ioloop import IOLoop | |
| CONTROL_THREAD_NAME = "Control" | |
| SHELL_CHANNEL_THREAD_NAME = "Shell channel" | |
| class BaseThread(Thread): | |
| """Base class for threads.""" | |
| def __init__(self, **kwargs): | |
| """Initialize the thread.""" | |
| super().__init__(**kwargs) | |
| self.io_loop = IOLoop(make_current=False) | |
| self.pydev_do_not_trace = True | |
| self.is_pydev_daemon_thread = True | |
| def run(self) -> None: | |
| """Run the thread.""" | |
| try: | |
| self.io_loop.start() | |
| finally: | |
| self.io_loop.close() | |
| def stop(self) -> None: | |
| """Stop the thread. | |
| This method is threadsafe. | |
| """ | |
| self.io_loop.add_callback(self.io_loop.stop) | |
Xet Storage Details
- Size:
- 785 Bytes
- Xet hash:
- 37aea9bd6cf8239bd5ab92d81aaeb636606bb7e85baa41984f184341b339ab10
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.