Use hinshun/cancel for cancellable readers without data being consumed
Eliminate a lot of code with a proper cancellable reader.
The Cancel() method returns bool to indicate whether it was successfully canceled. We could possibly plumb that somehow to the user, but there's no much they can do about it because its platform specific.
Looks like someone else already hoisted the package, so I'll let them maintain it: https://github.com/muesli/cancelreader
Need to contrib some PRs there first though.
My patches were upstreamed to: https://github.com/muesli/cancelreader And I've updated this PR accordingly.
We should probably test this with downstreams before considering merging this.
@hinshun: Might be nice to get this one wrapped up. It seemed like a worthwhile improvement.
LGTM