austinjones / postage-rs

The feature-rich, portable async channel library
MIT License
253 stars 9 forks source link

FilterStream needs some kind of backoff/sleep #10

Open austinjones opened 3 years ago

austinjones commented 3 years ago

The FilterStream currently loops on Ready values, until a match is found. It's possible to write a malicious stream and filter that would infinitely loop:

filter = |v| false;
stream = ready(1)

This stream would never return Pending, which results in a FilterStream that loops.