SXXXXXXX_ControlPanel/utils.py
VALLONGOL 1fcb8a3ead - gestione categorie su mfd
- sar con rotazione
- chiusura forzata applicazione
- applicazione lut lineare su mfd
2025-04-03 16:20:56 +02:00

31 lines
716 B
Python

# utils.py
"""
This module provides utility functions used throughout the application,
such as helper functions for queue management, status updates,
and other common tasks.
"""
import queue
def put_queue(queue, item):
"""
Puts an item in the queue. If the queue is full, the item is discarded.
Args:
queue (queue.Queue): The queue to put the item in.
item (any): The item to put in the queue.
"""
try:
queue.put(item, block=False)
except queue.Full:
pass # Drop value
def clear_queue(queue):
"""
Clears all items from the queue.
Args:
queue (queue.Queue): The queue to clear.
"""
with queue.mutex:
queue.queue.clear()