a2aproject / a2aproject/a2a-dotnet

Should ITaskManager handlers that are Task-returning Functions use the Async suffix?

未关闭
#88 9 条评论 0 个 reaction 已指派 1 人 已被 @adamsitnik 认领 在 GitHub 查看
主要语言
C#
星标
262
派生
64
平均合并
5 天 2 小时
30 天内合并 PR
31

描述

A question raised by @darrelmiller in https://github.com/a2aproject/a2a-dotnet/pull/87#discussion_r2223344286

Currently we [have](https://github.com/a2aproject/a2a-dotnet/blob/5c39c64c25d14a49c5c965002c98054f055a3b84/src/A2A/Server/ITaskManager.cs#L17-L49) few handlers that are Task-returning Funcs:

```cs
Func>? OnMessageReceived { get; set; }
Func OnTaskCreated { get; set; }
Func OnTaskCancelled { get; set; }
Func OnTaskUpdated { get; set; }
Func> OnAgentCardQuery { get; set; }
```

The interface also exposes async [methods](https://github.com/a2aproject/a2a-dotnet/blob/5c39c64c25d14a49c5c965002c98054f055a3b84/src/A2A/Server/ITaskManager.cs#L67-L173) that return `Task` directly and use `Async` suffix:

```cs
Task CreateTaskAsync(string? contextId = null, string? taskId = null, CancellationToken cancellationToken = default);
Task ReturnArtifactAsync(string taskId, Artifact artifact, CancellationToken cancellationToken = default);
```

贡献指南

打开贡献指南

调研方向

Examine ITaskManager.cs to understand the naming convention difference between Task-returning Func properties and async methods. Check the linked PR discussion for context. Determine if adding 'Async' suffix to the Func properties is appropriate and consistent. Look for any existing usage or tests of these handlers to assess impact.

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp
领域
backend-api-design
Issue 类型
重构
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。