memoryscope.core.operation.backend_operation
- class memoryscope.core.operation.backend_operation.BackendOperation(interval_time: int, **kwargs)[source]
Bases:
FrontendOperation
BaseBackendOperation serves as an abstract base class for defining backend operations. It manages operation status, loop control, and integrates with a global context for thread management.
- operation_type: Literal['frontend', 'backend'] = 'backend'
- init_workflow(**kwargs)[source]
Initializes the workflow by setting up workers with provided keyword arguments.
- Parameters:
**kwargs – Arbitrary keyword arguments to be passed during worker initialization.
- start_operation_backend(**kwargs)[source]
Initiates the background operation loop if it’s not already running. Sets the _loop_switch to True and submits the _loop_operation to a thread from the global thread pool.
- stop_operation_backend(wait_operation: bool = False)[source]
Stops the background operation loop by setting the _loop_switch to False.
- name: str
- memoryscope_context: MemoryscopeContext
- thread_pool: ThreadPoolExecutor
- workflow: str
- workflow_worker_list: List[List[List[str]]]
- worker_dict: Dict[str, BaseWorker | bool]
- workflow_context: Dict[str, Any]
- user_name: str
- target_names: List[str]
- description: str