redis-allocator 0.4.6__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {redis_allocator-0.4.6/redis_allocator.egg-info → redis_allocator-0.5.0}/PKG-INFO +1 -1
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/pyproject.toml +1 -1
- redis_allocator-0.5.0/redis_allocator/_version.py +1 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/redis_allocator/allocator.py +12 -3
- {redis_allocator-0.4.6 → redis_allocator-0.5.0/redis_allocator.egg-info}/PKG-INFO +1 -1
- redis_allocator-0.4.6/redis_allocator/_version.py +0 -1
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/LICENSE +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/README.md +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/redis_allocator/__init__.py +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/redis_allocator/lock.py +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/redis_allocator/task_queue.py +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/redis_allocator.egg-info/SOURCES.txt +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/redis_allocator.egg-info/dependency_links.txt +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/redis_allocator.egg-info/requires.txt +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/redis_allocator.egg-info/top_level.txt +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/setup.cfg +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/setup.py +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/tests/__init__.py +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/tests/conftest.py +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/tests/test_allocator.py +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/tests/test_lock.py +0 -0
- {redis_allocator-0.4.6 → redis_allocator-0.5.0}/tests/test_task_queue.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '0.5.0'
|
@@ -304,6 +304,11 @@ class RedisAllocatorPolicy(ABC, Generic[U]):
|
|
304
304
|
"""
|
305
305
|
pass
|
306
306
|
|
307
|
+
@abstractmethod
|
308
|
+
def refresh_pool_all(self, allocator: 'RedisAllocator[U]'):
|
309
|
+
"""Refresh the allocation pool."""
|
310
|
+
pass
|
311
|
+
|
307
312
|
def check_health_once(self, r_obj: RedisAllocatorObject[U], duration: int = 3600) -> bool:
|
308
313
|
"""Check the health of the object."""
|
309
314
|
with contextlib.closing(r_obj.open()):
|
@@ -405,6 +410,10 @@ class DefaultRedisAllocatorPolicy(RedisAllocatorPolicy[U]):
|
|
405
410
|
self._update_lock_key = f"{allocator._pool_str()}|policy_update_lock"
|
406
411
|
atexit.register(lambda: self.finalize(self._allocator()))
|
407
412
|
|
413
|
+
def refresh_pool_all(self, allocator: 'RedisAllocator[U]'):
|
414
|
+
for _ in range(self.updater.params):
|
415
|
+
self.refresh_pool(allocator)
|
416
|
+
|
408
417
|
def malloc(self, allocator: 'RedisAllocator[U]', timeout: Timeout = 120,
|
409
418
|
obj: Optional[U] = None, params: Optional[dict] = None,
|
410
419
|
cache_timeout: Timeout = 3600) -> Optional[RedisAllocatorObject[U]]:
|
@@ -786,9 +795,9 @@ class RedisAllocator(RedisLockPool, Generic[U]):
|
|
786
795
|
push_to_tail(itemName, expiry)
|
787
796
|
end
|
788
797
|
else
|
789
|
-
if locked then
|
790
|
-
|
791
|
-
end
|
798
|
+
-- if locked then
|
799
|
+
-- set_item_allocated(itemName, value)
|
800
|
+
-- end
|
792
801
|
end
|
793
802
|
end
|
794
803
|
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = '0.4.6'
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{redis_allocator-0.4.6 → redis_allocator-0.5.0}/redis_allocator.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|