NFIBrokerage / spear

A sharp EventStoreDB v20+ client backed by Mint :yum:
https://hex.pm/packages/spear
Apache License 2.0
85 stars 14 forks source link

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

Closed the-mikedavis closed 7 months ago

the-mikedavis commented 7 months ago

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 commented 7 months ago

Pull Request Test Coverage Report for Build 66bb14c8f592492371af42fb3a6133ee1a972035


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

💛 - Coveralls