fix: add lock map data structure, fixed bug for 'concurrent map writes'

This commit is contained in:
RockYang
2023-06-16 15:32:11 +08:00
parent c9875d24b4
commit 111572e3f2
10 changed files with 191 additions and 54 deletions

View File

@@ -1,6 +1,7 @@
package main
import (
"chatplus/core/types"
"chatplus/store/model"
"chatplus/store/vo"
"chatplus/utils"
@@ -16,7 +17,11 @@ import (
)
func main() {
//resp.JSON(nil, types.Success, types.OkMsg, new)
lMap := types.NewLMap[string, types.ChatSession]()
lMap.Put("name", types.ChatSession{SessionId: utils.RandString(32)})
item := lMap.Get("abc")
fmt.Println(item)
}
// Http client 取消操作