8000 Implement asynchronous unpacking API by friedkeenan · Pull Request #2 · friedkeenan/pak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Implement asynchronous unpacking API #2

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

Merged
merged 32 commits into from
Dec 27, 2024
Merged

Implement asynchronous unpacking API #2

merged 32 commits into from
Dec 27, 2024

Conversation

friedkeenan
Copy link
Owner

There are certain protocols which do not know how much data their packets take up before unpacking them, which poses a problem when attempting to parse such packets from an asyncio.StreamReader. Therefore after much deliberation, I have decided to implement an asynchronous API adjacent to the pre-existing synchronous one.

It will be up to each Type to implement one API or the other or both, and I aim for pre-existing user code to be largely, if not totally, unaffected.

All types in Pak will support both APIs, and testing will need to be adjusted accordingly. Towards that, the pak.test APIs will also be updated to ease that testing.

I don't envision these changes to be so invasive towards the codebase, but it will result in largely duplicate codepaths for synchronous and asynchronous unpacking. Unfortunately, it seems to me the best option.

@codecov
Copy link
codecov bot commented Oct 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (74fb345) to head (2782226).
Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main        #2    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           28        28            
  Lines         1843      2136   +293     
==========================================
+ Hits          1843      2136   +293     

☔ 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.

@friedkeenan
Copy link
Owner Author

Tests will be converted to the new testing APIs for Packet once more Types have had the asynchronous API implemented for them, which should bring the code coverage back up to 100%.

@friedkeenan
Copy link
Owner Author

I'm being a little sloppier than I normally would be with commit hygiene and whatnot, but only because I expect this PR to be merged soon and want to focus on that

@friedkeenan friedkeenan merged commit 1e6528a into main Dec 27, 2024
11 checks passed
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
0