-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a cap on total queue files #20
Conversation
This commit adds a `max_disk_files` option to `channel_with_explicit_capacity` that allows the caller to set the total amount of on-disk consumption. The caller may choose to loop on a send which results in `hopper::Error::Full` or drop the data and try again later. Hopper will _not_ block sends when there is no space available -- in memory or disk -- to store the item. This work is done in the service of supporting postmates/cernan#411 and postmates/cernan#412. Signed-off-by: Brian L. Troutwine <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me, though I'll wait for someone with a bit more Hopper and Rust experience to approve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor documentation change requested, otherwise lgtm
README.md
Outdated
|
||
`hopper::channel_with_max_bytes` takes a `max_disk_files` argument, defining the | ||
total number of overflow files that can exist concurrently. If all memory and | ||
disk buffers are full sends into the queue will fail but the error result is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the sentence beginning If all memory...
is difficult to read. the verbal noun sends
can be confusing. i'd also strongly recommend breaking the error result subordinate clause into it's own sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about are full, sends into the queue fill fail. However, the error result is implemented such that the caller...
This clarifies the noun-ness of sends by explicitly breaking the if clause into predicate and effect, and avoids the word "written" which can be ambiguous when used to mean 'how the code is written' while talking about a system that writes to disk.
The language in the README was a touch confusing. If it's still confusing it's no longer confusing in the same way. Signed-off-by: Brian L. Troutwine <[email protected]>
This commit adds a
max_disk_files
option tochannel_with_explicit_capacity
that allows the caller to set the total amount of on-disk consumption. The caller may choose to loop on a send which results inhopper::Error::Full
or drop the data and try again later. Hopper will not block sends when there is no space available -- in memory or disk -- to store the item.This work is done in the service of supporting postmates/cernan#411 and postmates/cernan#412.
Signed-off-by: Brian L. Troutwine [email protected]