MaxKB/apps/common/lock/base_lock.py
2024-08-21 14:46:38 +08:00

21 lines
319 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding=utf-8
"""
@project: MaxKB
@Author
@file base_lock.py
@date2024/8/20 10:33
@desc:
"""
from abc import ABC, abstractmethod
class BaseLock(ABC):
@abstractmethod
def try_lock(self, key, timeout):
pass
@abstractmethod
def un_lock(self, key):
pass