fusenapi/server/websocket/internal/logic/ws_allocation_processing_factory.go
laodaming aa4acd1bd2 fix
2023-10-30 18:26:52 +08:00

21 lines
528 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{}, //渲染工厂
}
func (w *wsConnectItem) newAllocationProcessor(msgType constants.Websocket) allocationProcessorFactory {
return mapAllocationProcessor[msgType]
}