a2aproject / a2aproject/a2a-dotnet

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

Đang mở
#88 9 bình luận 0 reaction 1 người được giao Được @adamsitnik nhận Xem trên GitHub
Ngôn ngữ chính
C#
Star
262
Fork
64
Merge trung bình
5 ngày 2 giờ
Pull request đã merge (30 ngày)
31

Mô tả

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);
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp
Lĩnh vực
backend-api-design
Loại issue
Tái cấu trúc
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.