让任务可以提供自身使用设备
This commit is contained in:
		@@ -14,6 +14,15 @@ type Task interface {
 | 
			
		||||
	// log: 任务执行的上下文。
 | 
			
		||||
	// executeErr: 从 Execute 方法返回的原始错误。
 | 
			
		||||
	OnFailure(executeErr error)
 | 
			
		||||
 | 
			
		||||
	TaskDeviceIDResolver
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TaskDeviceIDResolver 定义了从任务配置中解析设备ID的方法
 | 
			
		||||
type TaskDeviceIDResolver interface {
 | 
			
		||||
	// ResolveDeviceIDs 从任务配置中解析并返回所有关联的设备ID列表
 | 
			
		||||
	// 返回值: uint数组,每个字符串代表一个设备ID
 | 
			
		||||
	ResolveDeviceIDs() ([]uint, error)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TaskFactory 是一个工厂接口,用于根据任务执行日志创建任务实例。
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user