Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConvQueueMap<V>

Implementation of IQueueMap that converts values to 'parsed' representations using the given TypeConversion.

Type parameters

  • V

Hierarchy

  • ConvQueueMap

Implements

Index

Constructors

  • Construct a new instance operating on the given map.

    The map must be of QUEUE or STACK type.

    Type parameters

    • V

    Parameters

    • ref: MapRef

      Reference to the map. See MapRef if you want to implement your own instances.

    • valueConv: TypeConversion<V>

      Type conversion for values

    Returns ConvQueueMap<V>

Accessors

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

    Returns IterableIterator<V>

  • empty(): boolean
  • 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

    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