Skip to content
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

Avoid creating tasks for starting/finishing the connection #826

Merged
merged 16 commits into from
Feb 17, 2024
Merged

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Feb 16, 2024

We end up creating a lot of tasks when the device is in deep sleep since its trying to reconnect. We can replace them with async_interrupt and futures. This simplifies the connection process and reduces the chance for races.

This also speeds up connections because we don't end up with 3 tasks to make a connection anymore, only 1

Copy link

codecov bot commented Feb 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (41eeabc) 100.00% compared to head (d2b0087) 100.00%.
Report is 3 commits behind head on main.

❗ Current head d2b0087 differs from pull request most recent head ad227cf. Consider uploading reports for the commit ad227cf to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #826   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         2433      2434    +1     
=========================================
+ Hits          2433      2434    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bdraco bdraco marked this pull request as ready for review February 17, 2024 02:46
@bdraco bdraco changed the title Refactor to avoid creating tasks for starting/finishing the connection Avoid creating tasks for starting/finishing the connection Feb 17, 2024
@bdraco bdraco merged commit e2bbbf4 into main Feb 17, 2024
8 checks passed
@bdraco bdraco deleted the no_inner_tasks branch February 17, 2024 02:47
persuader72 pushed a commit to EspMeshMesh/aioesphomeapi that referenced this pull request Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant