quic_pqueue (quic v1.10.0)

View Source

Summary

Functions

Append an entry to its urgency bucket.

Insert at the front of the urgency bucket. Used when a drain pops an entry and must put back an unsent remainder: appending it at the back would order it behind higher-offset entries of the same stream, and a later stream-flow-control block at the head then strands it forever (the peer cannot extend the window across the resulting data hole).

True when every bucket is empty.

An empty queue: eight empty buckets.

Remove and return the highest priority (lowest urgency) entry.

Peek at the highest priority entry without removing it.

Types

pqueue/0

urgency/0

-type urgency() :: 0..7.

Functions

in(Entry, Urgency, PQ)

-spec in(term(), urgency(), pqueue()) -> pqueue().

Append an entry to its urgency bucket.

in_front(Entry, Urgency, PQ)

-spec in_front(term(), urgency(), pqueue()) -> pqueue().

Insert at the front of the urgency bucket. Used when a drain pops an entry and must put back an unsent remainder: appending it at the back would order it behind higher-offset entries of the same stream, and a later stream-flow-control block at the head then strands it forever (the peer cannot extend the window across the resulting data hole).

is_empty(PQ)

-spec is_empty(pqueue()) -> boolean().

True when every bucket is empty.

new()

-spec new() -> pqueue().

An empty queue: eight empty buckets.

out(PQ)

-spec out(pqueue()) -> {{value, term()}, pqueue()} | {empty, pqueue()}.

Remove and return the highest priority (lowest urgency) entry.

peek(PQ)

-spec peek(pqueue()) -> {value, term()} | empty.

Peek at the highest priority entry without removing it.