You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
758 B
28 lines
758 B
|
6 months ago
|
namespace CoreAgent.Domain.Interfaces;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 命令策略工厂接口
|
||
|
|
/// </summary>
|
||
|
|
public interface ICommandStrategyFactory
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 创建命令策略
|
||
|
|
/// </summary>
|
||
|
|
/// <returns>命令策略实例</returns>
|
||
|
|
ICommandStrategy CreateStrategy();
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 命令策略接口
|
||
|
|
/// </summary>
|
||
|
|
public interface ICommandStrategy
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 执行命令并返回缓冲结果
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="command">要执行的命令</param>
|
||
|
|
/// <param name="source">取消令牌源</param>
|
||
|
|
/// <param name="logger">日志记录器</param>
|
||
|
|
/// <returns>命令执行结果</returns>
|
||
|
|
Task<string> ExecuteBufferedAsync(string command, CancellationTokenSource source);
|
||
|
|
}
|