Skip to content

Conversation

yoshuawuyts
Copy link
Collaborator

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!

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.

1 participant