Skip to content

Add missing Awaitable return types #749

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

Closed
wants to merge 1 commit into from

Conversation

natehardison
Copy link
Contributor

SSHServer.*_requested() callbacks can return Awaitables of their respective Session types, or a tuple consisting of a channel and a Session awaitable.

SSHServer.*_requested() callbacks can return Awaitables of their
respective Session types, or a tuple consisting of a channel and a
Session awaitable.
Copy link

codecov bot commented Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.83%. Comparing base (fab96ac) to head (9ba054f).
Report is 126 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #749      +/-   ##
===========================================
- Coverage    99.85%   99.83%   -0.02%     
===========================================
  Files           95      100       +5     
  Lines        27784    31386    +3602     
  Branches      2908     3026     +118     
===========================================
+ Hits         27743    31335    +3592     
- Misses          38       45       +7     
- Partials         3        6       +3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ronf
Copy link
Owner

ronf commented Apr 18, 2025

Thanks for submitting this!

You're right that all of the places you identified can accept a coroutine. However, I have a helper type called MaybeAwait that I generally use for signaling this. It wraps around a return type and automatically adds both the plain return type and an Awaitable of that type, cutting down on some of the duplication which would otherwise have been required here.

See commit 266a25f for the MaybeAwait version of this change. It should be the equivalent of what you suggested. If you find any problem with it, please let me know!

@ronf ronf closed this Apr 18, 2025
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.

2 participants