a2aproject / a2aproject/a2a-dotnet

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

Ouverte
#88 9 commentaires 0 réactions 1 personne assignée Réclamée par @adamsitnik Voir sur GitHub
Langage dominant
C#
Étoiles
262
Forks
64
Merge moyen
5 j 2 h
PR mergées (30 j)
31

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
csharp
Domaine
backend-api-design
Type d'issue
Refactorisation
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.