diff options
Diffstat (limited to 'searx/shared/shared_simple.py')
-rw-r--r-- | searx/shared/shared_simple.py | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/searx/shared/shared_simple.py b/searx/shared/shared_simple.py deleted file mode 100644 index 2b9d4c2da..000000000 --- a/searx/shared/shared_simple.py +++ /dev/null @@ -1,40 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later - -import threading -from typing import Optional - -from . import shared_abstract - - -class SimpleSharedDict(shared_abstract.SharedDict): - - __slots__ = ('d',) - - def __init__(self): - self.d = {} - - def get_int(self, key: str) -> Optional[int]: - return self.d.get(key, None) - - def set_int(self, key: str, value: int): - self.d[key] = value - - def get_str(self, key: str) -> Optional[str]: - return self.d.get(key, None) - - def set_str(self, key: str, value: str): - self.d[key] = value - - -def schedule(delay, func, *args): - def call_later(): - t = threading.Timer(delay, wrapper) - t.daemon = True - t.start() - - def wrapper(): - call_later() - func(*args) - - call_later() - return True |