-
Notifications
You must be signed in to change notification settings - Fork 466
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
timely-util/builder_async: offer automatically yielding give API #27866
Conversation
a1f6b22
to
d568e3d
Compare
Normal `Capability` values are the only thing currently exposed to users so there is no use for that trait anymore. Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
They are now synchronous so this commit removes all the `.await`s. Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
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.
LGTM
|
||
/// Provides one record at the time specified by the capability. This method will automatically | ||
/// yield back to timely after [Self::MAX_OUTSTANDING_BYTES] have been produced. | ||
pub async fn give_fueled<D2>(&mut self, cap: &Capability<T>, data: D2) |
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.
Note to future selves: Should this be #[inline]
?
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.
I believe this will always be considered for inlining (at least according to this article https://matklad.github.io/2021/07/09/inline-in-rust.html#Inlining-in-Rust) because the method is generic
Motivation
This PR offers a fueled give API that automatically yields back to timely after certain number of bytes have been emitted into the dataflow. The value is currently capped at 128MB, which is the size of a persist part. This API is only available for operators that make use of
StackWrapper
containers which can accurately track their heap size.As part of this PR I also made the original
give
andgive_container
methods synchronous. The only reason they were async in the first place was because I had initially envisioned this auto-yield API to be the default and so the async-ness was reserved. Since I no longer think this is a good idea I removed the async keyword.Tips for reviewer
The diff is big due to the last commit that contains all the removed
.await
calls. Only the changes intimely-util
need review. Everything else is mechanical.Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.