mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-27 14:20:27 +08:00
optimize: memory consumption
This commit is contained in:
@@ -3,13 +3,12 @@ package link
|
||||
import (
|
||||
"github.com/RomiChan/syncx"
|
||||
"github.com/fumiama/WireGold/gold/head"
|
||||
"github.com/fumiama/orbyte/pbuf"
|
||||
)
|
||||
|
||||
// 事件分发器
|
||||
var dispachers syncx.Map[uint8, Dispacher]
|
||||
|
||||
type Dispacher func(header *head.Packet, peer *Link, data pbuf.Bytes)
|
||||
type Dispacher func(header *head.Packet, peer *Link, data []byte)
|
||||
|
||||
// RegisterDispacher of proto
|
||||
func RegisterDispacher(p uint8, d Dispacher) (actual Dispacher, hasexist bool) {
|
||||
|
||||
Reference in New Issue
Block a user