JCS-pub/agent/internal/mq/service.go

27 lines
804 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package mq
import (
"gitlink.org.cn/cloudream/storage/agent/internal/task"
"gitlink.org.cn/cloudream/storage/common/pkgs/ioswitch"
)
// Service 表示一个消息队列服务
// 它包含了任务管理和IO切换器两个核心组件
type Service struct {
taskManager *task.Manager // taskManager 用于管理和调度任务
sw *ioswitch.Switch // sw 用于控制IO切换
}
// NewService 创建一个新的消息队列服务实例
// 参数:
// - taskMgr任务管理器负责任务的调度和管理
// - swIO切换器用于控制数据的输入输出
// 返回值:
// - *Service指向创建的消息队列服务实例的指针
func NewService(taskMgr *task.Manager, sw *ioswitch.Switch) *Service {
return &Service{
taskManager: taskMgr,
sw: sw,
}
}