module
Version:
v0.1.2
Opens a new window with list of versions in this module.
Published: Aug 6, 2023
License: MIT
Opens a new window with license information.
README
¶
glt
glt
全名 go-leo-tech
, 从工作中汇总出高效的工具集合
English
v0.1.0 [2023-08-01]
cache
-
SafeMemoryCache
:基于内存的安全高效缓存。
task
-
Worker
:高效的任务队列,通过chan解耦,生产者-消费者模型,对外开放等待完成接口。
-
Worker Group
:基于Worker
扩展出高效的Worker Group
,对外开放hash分类和等待接口。
-
Delay
: 添加延迟任务,在当前版本中添加太多延迟任务可能会导致内存溢出错误,这与添加数量有关。这是因为当协程太多时,每个协程都会创建一个计时器,这会消耗大量的内存资源。
util
-
String
:转换字符串。
-
IsImplements
:使用反射确定接口类型。
v0.1.1 [2023-08-02]
尝试解决go get 模块找不到的问题。
v0.1.2 [2023-08-06]
container/queue
-
PriorityQueue
:优先级队列,大根堆与小根堆根据compare
决定,支持泛型。
container/set
-
Set
:借用map数据结构封装的api,支持泛型。
task
-
DelayPool
:使用PriorityQueue
数据结构和Worker
实现延时任务池,避免tiem.After
同时创建过多chan
cache
TODO
-
Delay
:当添加过多延迟任务时,time.After
可能会导致内存溢出的问题。[在v0.1.2中DelayPool
进行了优化]
-
Set
:不支持并发操作。
Directories
¶
|
|
|
|
container
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.