hvl_ccb.dev.utils¶
- class Poller(spoll_handler: Callable, polling_delay_sec: Union[int, float] = 0, polling_interval_sec: Union[int, float] = 1, polling_timeout_sec: Optional[Union[int, float]] = None)[source]¶
Bases:
object
Poller class wrapping concurrent.futures.ThreadPoolExecutor which enables passing of results and errors out of the polling thread.
- is_polling() → bool[source]¶
Check if device status is being polled.
- Returns
True when polling thread is set and alive
- start_polling() → bool[source]¶
Start polling.
- Returns
True if was not polling before, False otherwise