Skip to content

Commit

Permalink
removed unused decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonzorn committed Mar 29, 2024
1 parent 3266bee commit 8be7ed1
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions nlightreader/utils/decorators.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from functools import wraps
from typing import Callable


def singleton(cls):
Expand All @@ -21,25 +20,3 @@ def wrapper(*args, **kwargs):
return instance[0]

return wrapper


def with_lock_thread(locker):
"""
A decorator that acquires a lock before executing a function in a threaded environment.
Parameters:
locker (threading.Lock): The lock object to acquire.
Returns:
callable: Decorator that acquires the lock before executing wrapped function.
"""

def decorator(func: Callable):
@wraps(func)
def wrapper(*args, **kwargs):
with locker:
return func(*args, **kwargs)

return wrapper

return decorator

0 comments on commit 8be7ed1

Please sign in to comment.