proxystore.utils.counter¶
Atomic counting utilities.
AtomicCounter
¶
AtomicCounter(size: int | None = None)
Thread-safe counter.
Parameters:
-
size
(int | None
, default:None
) –Optional max count upon which an exception will be raised.
Source code in proxystore/utils/counter.py
increment
¶
increment() -> int
Get current count and increment value.
Returns:
-
int
–Current count.
Raises:
-
ValueError
–If current count is equal to or greater than size.