Initializes the limit functionality outlined in #1. This only updates the traits to contain the functionality, and provide the methods. It does not yet enforce the limits, however.
The impl on how to enforce it is probably to create a stream wrapper that returns a tuple of (item, guard) that increments an internal counter if a limit has been set. Then when the guard is dropped, using an AtomicWaker it can wake the stream up to continue polling (while checking capacity).
Either way, this is a required first step to get us forward. Thanks!
Initializes the
limit
functionality outlined in #1. This only updates the traits to contain the functionality, and provide the methods. It does not yet enforce the limits, however.The impl on how to enforce it is probably to create a stream wrapper that returns a tuple of
(item, guard)
that increments an internal counter if a limit has been set. Then when the guard is dropped, using anAtomicWaker
it can wake the stream up to continue polling (while checking capacity).Either way, this is a required first step to get us forward. Thanks!