[dotnet] [bidi] Simplified how background tasks are started#17198
Merged
nvborisenko merged 1 commit intoSeleniumHQ:trunkfrom Mar 10, 2026
Merged
[dotnet] [bidi] Simplified how background tasks are started#17198nvborisenko merged 1 commit intoSeleniumHQ:trunkfrom
nvborisenko merged 1 commit intoSeleniumHQ:trunkfrom
Conversation
Contributor
Review Summary by QodoSimplify background task initialization using Task.Run
WalkthroughsDescription• Replaced custom TaskFactory with standard Task.Run method • Removed static TaskFactory instances from Broker and EventDispatcher • Simplified background task initialization in two classes • Improved code readability and maintainability File Changes1. dotnet/src/webdriver/BiDi/Broker.cs
|
Contributor
Code Review by Qodo
1. Broker Task.Run untested
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors .NET BiDi background task startup by removing a custom TaskFactory and using Task.Run instead, simplifying task creation in the BiDi message broker and event dispatcher.
Changes:
- Replace
TaskFactory.StartNew(...).Unwrap()withTask.Run(...)inEventDispatcher. - Replace
TaskFactory.StartNew(..., LongRunning).Unwrap()withTask.Run(...)inBroker.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| dotnet/src/webdriver/BiDi/EventDispatcher.cs | Starts the event processing background loop using Task.Run instead of a static TaskFactory. |
| dotnet/src/webdriver/BiDi/Broker.cs | Starts the message receiving loop using Task.Run, removing the custom TaskFactory usage. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove TaskFactory to start tasks.
💥 What does this PR do?
This pull request refactors the way background tasks are started in the
BrokerandEventDispatcherclasses. The changes simplify task creation by replacing the customTaskFactorywith the standardTask.Runmethod, making the code easier to read and maintain.🔄 Types of changes