From f1e0334ce390b370b47f99306795004839ba04f6 Mon Sep 17 00:00:00 2001 From: KenanZhu <3471685733@qq.com> Date: Fri, 16 Jan 2026 23:41:25 +0800 Subject: [PATCH] =?UTF-8?q?docs(MsgBase,=20LibOperator):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=B9=B6=E5=AE=8C=E5=96=84=E7=B1=BB=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/LibOperator.py | 7 +++++++ src/base/MsgBase.py | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/base/LibOperator.py b/src/base/LibOperator.py index 5f005f9..b1219ca 100644 --- a/src/base/LibOperator.py +++ b/src/base/LibOperator.py @@ -13,6 +13,13 @@ from base.MsgBase import MsgBase class LibOperator(MsgBase): + """ + Base abstract class for library operation. + + This class provides the foundation for library-related operations, inheriting + message handling and tracing abilities from MsgBase. It serves as an abstract + base class that must be subclassed to implement specific library functionality. + """ def __init__( self, diff --git a/src/base/MsgBase.py b/src/base/MsgBase.py index 4d9362f..ad271ac 100644 --- a/src/base/MsgBase.py +++ b/src/base/MsgBase.py @@ -12,6 +12,22 @@ import queue class MsgBase: + """ + Base class for message and trace abilities (thread-safe). + + This class provides the foundation for message handling and tracing + abilities based on the provided input and output queues. It enables + thread-safe communication between components using queue-based messaging. + + Args: + input_queue (queue.Queue): The input queue for receiving messages. + output_queue (queue.Queue): The output queue for sending messages. + + Usage: + This class must be initialized with input and output queues. The queue + provider (the caller of this class or its subclasses) must explicitly + implement queue polling to retrieve and process messages. + """ def __init__( self,