22 lines
550 B
Go
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]
|
|
}
|