Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IQueueMap<V>

Specialized version of IMap for queue types, currently QUEUE and STACK.

RawQueueMap returns queue values directly as Buffer with no conversion, and ConvQueueMap performs the conversion specified at construction time.

Type parameters

  • V

Hierarchy

  • IQueueMap

Implemented by

Index

Methods Convenience

Methods Operations

Convenience Methods

  • [iterator](): IterableIterator<V>
  • consumeValues(limit?: number): IterableIterator<V>
  • Convenience function. Consumes values repeatedly until the queue is empty.

    In cases where another program is pushing things to the queue concurrently, it is recommended to place a limit to avoid loop starvation.

    Parameters

    • Optional limit: number

      Maximum amount of values to consume

    Returns IterableIterator<V>

  • empty(): boolean
  • Convenience function. Tests if the queue is empty.

    Returns boolean

Operations Methods

  • freeze(): void
  • Freezes the map, making it non-modifiable from userspace. The map stays writeable from BPF side.

    Since Linux 5.2.

    Returns void

  • peek(flags?: number): undefined | V
  • Get the next value without removing it from the queue.

    Parameters

    • Optional flags: number

      Operation flags (since Linux 5.1), see MapLookupFlags

    Returns undefined | V

    Entry value, or undefined if the queue is empty

  • pop(): undefined | V
  • Consume the next value from the queue.

    Returns undefined | V

    Entry value, or undefined if the queue is empty

Generated using TypeDoc