- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 8.6k
 
[dotnet][bidi] Use channels dependency for producer/consumer #15249
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
Conversation
          PR Reviewer Guide 🔍Here are some key observations to aid the review process: 
  | 
    
          PR Code Suggestions ✨Explore these optional code suggestions: 
  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice changes! How does this affect performance/memory?
          
 Didn't test it accurately without remote-end party. But I don't expect performance improvement here.  | 
    
| 
           Hm, now I am struggled: do we really want to introduce new dependency instead of   | 
    
| 
           
 
 Additionally, this only adds a new dependency on older TFMs. I don't know the stats about how many people use the .NET 8 version vs. the .NET Standard version, but the kinds of blockers which prevent upgrades to modern .NET are not usually present in code that uses Selenium. For this reason, a dependency that only exists on older .NET versions seems less critical.  | 
    
| 
           Thanks @nvborisenko for contribution. I decided (8 Feb) to not introduce new dependency to fix mimic issue/improvement. In case of any issues, please came in here.  | 
    
User description
Motivation and Context
Now we are dependent on
System.Threading.Channelspackage fornetstandard2.0target only.net8is still free of dependencies.Types of changes
Checklist
PR Type
Enhancement, Dependencies
Description
Replaced
BlockingCollectionwithChannelfor event handling.Updated
Brokerclass to useSystem.Threading.Channels.Added
System.Threading.Channelsas a dependency in multiple files.Improved task management and event processing loops.
Changes walkthrough 📝
Broker.cs
Refactored `Broker` to use `Channel` for eventsdotnet/src/webdriver/BiDi/Communication/Broker.cs
BlockingCollectionwithChannelfor event handling.Channelfor writing and reading events.TaskFactoryand improved task management.BUILD.bazel
Added `System.Threading.Channels` to Bazel dependenciesdotnet/src/webdriver/BUILD.bazel
System.Threading.Channelsas a dependency for Bazel build.WebDriver.StrongNamed.nuspec
Added `System.Threading.Channels` to StrongNamed nuspecdotnet/src/webdriver/WebDriver.StrongNamed.nuspec
System.Threading.Channelsdependency fornetstandard2.0.WebDriver.nuspec
Added `System.Threading.Channels` to WebDriver nuspecdotnet/src/webdriver/WebDriver.nuspec
System.Threading.Channelsdependency fornetstandard2.0.WebDriver.csproj
Added `System.Threading.Channels` to csproj dependenciesdotnet/src/webdriver/WebDriver.csproj
System.Threading.Channelspackage fornetstandard2.0.paket.dependencies
Added `System.Threading.Channels` to Paket dependenciesdotnet/paket.dependencies
System.Threading.Channelsversion 8.0.0 to Paket dependencies.