From 632846463c24ed891898b9488607c5170023bf11 Mon Sep 17 00:00:00 2001 From: lizhen Date: Mon, 30 Oct 2023 19:48:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9756ff4..0d7509f 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过程中, -- Gitee