We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccf6f86 commit ccc07abCopy full SHA for ccc07ab
src/labthings/actions/pool.py
@@ -2,23 +2,23 @@
2
import threading
3
from functools import wraps
4
5
+from ..deque import Deque
6
from .thread import ActionThread
7
8
-# TODO: Handle discarding old actions. Action views now use deques
9
class Pool:
10
""" """
11
12
- def __init__(self):
13
- self.threads = set()
+ def __init__(self, maxlen: int = 100):
+ self.threads = Deque(maxlen=maxlen)
14
15
def add(self, thread: ActionThread):
16
"""
17
18
:param thread: ActionThread:
19
20
21
- self.threads.add(thread)
+ self.threads.append(thread)
22
23
def start(self, thread: ActionThread):
24
0 commit comments