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

End the Spear.stream! stream early when reading a chunk smaller than requested #93

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

the-mikedavis
Copy link
Collaborator

Connects #92.

If we read a chunk from the server smaller than what we requested then we can assume that there is no more stream to read and any subsequent reads would be empty. We can bail out of the Stream.unfold early in this case to prevent an extra network call and reduce latency.

@coveralls
Copy link

coveralls commented Jan 27, 2024

Pull Request Test Coverage Report for Build 66bb14c8f592492371af42fb3a6133ee1a972035

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build a0d5001a43bd8b3489171a5ceef0f5f329379d25: 0.0%
Covered Lines: 709
Relevant Lines: 709

💛 - Coveralls

@the-mikedavis the-mikedavis merged commit 66bb14c into main Feb 2, 2024
12 checks passed
@the-mikedavis the-mikedavis deleted the short-circuit-stream-chunks branch February 2, 2024 19:34
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.

None yet

2 participants