# `TimedQueue`

digraph inheritancefe44d8c341 { bgcolor=transparent; rankdir=UD; ratio=compress; size="8.0, 12.0"; "TimedQueue" [URL="#taurus.core.util.containers.TimedQueue",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="A FIFO that keeps all the values introduced at least for a given time."]; }

class TimedQueue(arg=None)

  A FIFO that keeps all the values introduced at least for a given time. Applied to some device servers, to force States to be kept at least a minimum time. Previously named as PyTango_utils.device.StateQueue pop(): The value is removed only if delete_time has been reached. at least 1 value is always kept in the list

  Import from `taurus.core.util.containers` as:

      from taurus.core.util.containers import TimedQueue

  append(obj, keep=15)

    Inserts a tuple with (value,insert_time,delete_time=now+keep)

  index(obj)

    Return first index of value.

    Raises ValueError if the value is not present.

  pop(index=0)

    Returns the indicated value, or the first one; but removes only if delete_time has been reached. All values are returned at least once. When the queue has only a value, it is not deleted.