customheap

package
v0.0.0-...-58c0a64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AckMessageWithDeadline

type AckMessageWithDeadline struct {
	MsgID       string
	AckDeadline int32
	Index       int // The index of the item in the customheap.
}

AckMessageWithDeadline ...

func (*AckMessageWithDeadline) HasHitDeadline

func (ackMsg *AckMessageWithDeadline) HasHitDeadline() bool

HasHitDeadline ...

type AckMessageWithOffset

type AckMessageWithOffset struct {
	MsgID  string
	Offset int32
	Index  int // The index of the item in the customheap.
}

AckMessageWithOffset ...

type DeadlineBasedPriorityQueue

type DeadlineBasedPriorityQueue struct {
	Indices             []*AckMessageWithDeadline
	MsgIDToIndexMapping map[string]int
}

DeadlineBasedPriorityQueue ...

func NewDeadlineBasedPriorityQueue

func NewDeadlineBasedPriorityQueue() DeadlineBasedPriorityQueue

NewDeadlineBasedPriorityQueue ...

func (DeadlineBasedPriorityQueue) IsEmpty

func (pq DeadlineBasedPriorityQueue) IsEmpty() bool

IsEmpty ...

func (DeadlineBasedPriorityQueue) Len

Len ...

func (DeadlineBasedPriorityQueue) Less

func (pq DeadlineBasedPriorityQueue) Less(i, j int) bool

Less ...

func (*DeadlineBasedPriorityQueue) Pop

func (pq *DeadlineBasedPriorityQueue) Pop() interface{}

Pop we just implement the pre-defined function in interface of heap.

func (*DeadlineBasedPriorityQueue) Push

func (pq *DeadlineBasedPriorityQueue) Push(x interface{})

Push ...

func (DeadlineBasedPriorityQueue) Swap

func (pq DeadlineBasedPriorityQueue) Swap(i, j int)

Swap ...

type OffsetBasedPriorityQueue

type OffsetBasedPriorityQueue struct {
	Indices             []*AckMessageWithOffset
	MsgIDToIndexMapping map[string]int
}

OffsetBasedPriorityQueue ...

func NewOffsetBasedPriorityQueue

func NewOffsetBasedPriorityQueue() OffsetBasedPriorityQueue

NewOffsetBasedPriorityQueue ...

func (OffsetBasedPriorityQueue) IsEmpty

func (pq OffsetBasedPriorityQueue) IsEmpty() bool

IsEmpty ...

func (OffsetBasedPriorityQueue) Len

func (pq OffsetBasedPriorityQueue) Len() int

Len ...

func (OffsetBasedPriorityQueue) Less

func (pq OffsetBasedPriorityQueue) Less(i, j int) bool

Less ...

func (*OffsetBasedPriorityQueue) Pop

func (pq *OffsetBasedPriorityQueue) Pop() interface{}

Pop we just implement the pre-defined function in interface of heap

func (*OffsetBasedPriorityQueue) Push

func (pq *OffsetBasedPriorityQueue) Push(x interface{})

Push ...

func (OffsetBasedPriorityQueue) Swap

func (pq OffsetBasedPriorityQueue) Swap(i, j int)

Swap ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL