diff --git a/README.md b/README.md index 9756ff40302e07f2fd10a31797b0fd62944878c4..0d7509f6cdadc925c7b7a3313801a8e26304ab93 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,14 @@ #### 核心流程说明 ##### 1. 定义id生成器结构体 - ``` +``` type IdSequence struct { idListLength int64 // 号段长度,可根据业务qps自行设置 biz string // 业务类型 ids chan int64 // 生成的id list, chan通道 stopMonitor chan bool // 停止标志channel类型 } +``` ##### 2. id生成器共有Monitor,GetOne, Close三个对外暴露的方法。 Monitor方法主要实现对id list的监控,当检测到id list为空时,会调用add方法,向id list中添加idListLength个新id,在添加新id过程中,