fusenapi/server/websocket/internal/logic/ws_allocation_processing_factory.go
laodaming eca69bb085 fix
2023-11-06 10:06:33 +08:00

22 lines
550 B
Go

package logic
import (
"fusenapi/constants"
)
// 消息分发工厂
type allocationProcessorFactory interface {
//分配数据到缓冲队列
allocationMessage(w *wsConnectItem, data []byte)
}
// 要添加分发在这里
var mapAllocationProcessor = map[constants.Websocket]allocationProcessorFactory{
constants.WEBSOCKET_RENDER_IMAGE: &renderProcessor{}, //渲染工厂
}
// new消息处理器
func (w *wsConnectItem) newAllocationProcessor(msgType constants.Websocket) allocationProcessorFactory {
return mapAllocationProcessor[msgType]
}