package
0.0.0-20230424045628-a36dcc1d90e4
Repository: https://github.com/weedge/lib.git
Documentation: pkg.go.dev
# README
介绍
队列库,提供优先队列,延迟队列基础操作
功能
- priority_queue: 优先队列,基于container/heap实现,采用min heap结构,提供Push,Pop, Top, PeekAndShift, Update 等操作函数接口
- delay_queue: 延迟队列, 基于优先队列,提供Offer, Poll, Do 操作函数,Offer(添加 bucket)和 Poll(获取并删除 bucket)的运作方式,
tips
heap 使用场景:最小顶堆,最大顶堆;优先级队列;有序小文件合并成大文件;定时任务; golang timer采用最小顶堆实现;
# Functions
New creates an instance of delayQueue with the specified size.
No description provided by the author
# Structs
DelayQueue is an unbounded blocking queue of *Delayed* elements, in which an element can only be taken when its delay has expired.
No description provided by the author
# Type aliases
this is a priority queue as implemented by a min heap ie.