From 9eb18698cd4493a52437aaa232ba1f6b8673ad5e Mon Sep 17 00:00:00 2001 From: rmlibre Date: Sat, 1 Jun 2024 15:47:00 -0400 Subject: [PATCH] v0.23.2: Troubleshoot cross-platform time, async, & multiprocessing errors. --- aiootp/asynchs/threads.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aiootp/asynchs/threads.py b/aiootp/asynchs/threads.py index 5b11354..8abe281 100644 --- a/aiootp/asynchs/threads.py +++ b/aiootp/asynchs/threads.py @@ -18,6 +18,7 @@ from threading import Thread +from collections import deque import concurrent.futures.thread as thread from _thread import get_ident as get_thread_id from concurrent.futures import ThreadPoolExecutor @@ -39,13 +40,14 @@ class Threads(ConcurrencyInterface): class _Manager: """ This type is for parity with the `Processes` class' use of the - `multiprocessing.Manager`. It returns a list so state can be - passed around from spawned threads to calling code. + `multiprocessing.Manager`. It returns an atomic list-like + container so state can be passed around from spawned threads to + calling code. """ @staticmethod - def list(): - return [] + def list() -> t.Sequence[t.Any]: + return deque(maxlen=1) _default_probe_delay: t.PositiveRealNumber = 0.001 _pool: t.PoolExecutorType = ThreadPoolExecutor()