implementation of thread safe queue with a size limit in python code example
Example: queue python
from queue import Queue
q = Queue()
q.size() # returns the current lenght of queue
q.empty() # returns True if empty, False otherwise
q.put(item)
q.get()