-
-
Notifications
You must be signed in to change notification settings - Fork 604
optimize Task.WaitAll #1261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimize Task.WaitAll #1261
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
|
reviewed |
PR Type
Enhancement
Description
Replace Task.WaitAll with async/await foreach loops
Convert synchronous methods to async Task-returning methods
Update test mock implementations to match async signatures
Diagram Walkthrough
File Walkthrough
TextCompletionProvider.cs
Replace Task.WaitAll with async foreach loopssrc/Plugins/BotSharp.Plugin.AzureOpenAI/Providers/Text/TextCompletionProvider.cs
Task.WaitAllwithforeachloop andawaitforBeforeGeneratinghook
Task.WaitAllwithforeachloop andawaitforAfterGeneratedhook
TextCompletionProvider.cs
Replace Task.WaitAll with async foreach loopssrc/Plugins/BotSharp.Plugin.OpenAI/Providers/Text/TextCompletionProvider.cs
Task.WaitAllwithforeachloop andawaitforBeforeGeneratinghook
Task.WaitAllwithforeachloop andawaitforAfterGeneratedhook
TencentCosService.User.cs
Convert user avatar methods to asyncsrc/Plugins/BotSharp.Plugin.TencentCos/Services/TencentCosService.User.cs
GetUserAvatar()from synchronous toasync TaskSaveUserAvatar()from synchronous toasync Taskawaitkeyword fordb.GetUserById()calls to support asyncoperations
NullConversationStateService.cs
Update conversation state service to asynctests/BotSharp.LLM.Tests/Core/NullConversationStateService.cs
Load()method to returnTask>Save()method to returnTaskinstead of voidTask.FromResult()andTask.CompletedTaskNullFileStorageService.cs
Update file storage mock to async signaturestests/BotSharp.LLM.Tests/Core/NullFileStorageService.cs
GetUserAvatar()to returnTaskSaveUserAvatar()to returnTaskTask.FromResult()TestAgentService.cs
Update agent service mock to asynctests/BotSharp.LLM.Tests/Core/TestAgentService.cs
GetPlugin()method to returnTaskTask.FromResult()