Skip to content
Eddie Kohler edited this page Oct 17, 2017 · 4 revisions

NotifierQueue Element Documentation

NAME

NotifierQueue — Click element; stores packets in a FIFO queue

SYNOPSIS

NotifierQueue
NotifierQueue(CAPACITY)

Ports: 1 input, 1-2 outputs

DESCRIPTION

Stores incoming packets in a first-in-first-out queue. Drops incoming packets if the queue already holds CAPACITY packets. The default for CAPACITY is 1000.

NotifierQueue notifies interested parties when it becomes empty and when a formerly-empty queue receives a packet. The empty notification takes place some time after the queue goes empty, to prevent thrashing for queues that hover around 1 or 2 packets long. In all other respects, NotifierQueue behaves like SimpleQueue.

Multithreaded Click note: NotifierQueue is designed to be used in an environment with at most one concurrent pusher and at most one concurrent puller. Thus, at most one thread pushes to the NotifierQueue at a time and at most one thread pulls from the NotifierQueue at a time. Different threads can push to and pull from the NotifierQueue concurrently, however. See ThreadSafeQueue for a queue that can support multiple concurrent pushers and pullers.

NOTES

The Queue element acts like NotifierQueue, but additionally notifies interested parties when it changes state from nonfull to full or vice versa.

ELEMENT HANDLERS

  • length (read-only) — Returns the current number of packets in the queue.
  • highwater_length (read-only) — Returns the maximum number of packets that have ever been in the queue at once.
  • capacity (read/write) — Returns or sets the queue's capacity.
  • drops (read-only) — Returns the number of packets dropped by the queue so far.
  • reset_counts (write-only) — When written, resets the drops and highwater_length counters.
  • reset (write-only) — When written, drops all packets in the queue.

SEE ALSO

Queue, QuickNoteQueue, SimpleQueue, MixedQueue, FrontDropQueue, ThreadSafeQueue

Generated by click-elem2man from ../elements/standard/notifierqueue.hh:9 on 2017/10/17.

Clone this wiki locally