Skip to content
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: make AsyncOutputHandle::give generic over the container builder #27825

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

petrosagg
Copy link
Contributor

Motivation

This PR enables using the .give() API for any container builder that supports it. Only the first commit needs to be reviewed, the second one is a mechanical change since more type annotations are now needed that were previously inferred.

Tips for reviewer

Checklist

Copy link
Member

@antiguru antiguru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, leaving one comment to make the diff smaller.

@@ -19,6 +19,7 @@ use std::hash::Hash;
use std::pin::Pin;
use std::sync::Arc;
use std::time::Instant;
use timely::container::CapacityContainerBuilder;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: move down to the next block.

{
#[allow(clippy::unused_async)]
pub async fn give<C: CapabilityTrait<T>>(&mut self, cap: &C, data: D) {
pub async fn give<C, D>(&mut self, cap: &C, data: D)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use the same trick that timely uses: Implement give for a handle that is specialized to CapacityContainerBuilder and generic over a container, and add a separate give_with_builder that's implemented for handles generic over any container builder. This would remove the need for the second commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea! I actually only want give to be generic over the container so I'll skip adding a give_with_builder for now

@jkosh44 jkosh44 removed their request for review June 24, 2024 13:45
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
@petrosagg petrosagg enabled auto-merge June 25, 2024 13:59
@petrosagg petrosagg merged commit 5e185a4 into MaterializeInc:main Jun 25, 2024
76 checks passed
@petrosagg petrosagg deleted the async-builder-containers branch June 25, 2024 14:59
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.

2 participants