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

Implement primitive CreateTopics and DeleteTopics methods #8

Merged
merged 1 commit into from
May 17, 2024

Conversation

ncalibey
Copy link
Contributor

No description provided.

examples/create_topic.rs Outdated Show resolved Hide resolved
@ncalibey ncalibey force-pushed the create-topics branch 2 times, most recently from 9bf6dfa to 3c6ae26 Compare May 13, 2024 16:31
@ncalibey ncalibey changed the title Implement primitive CreateTopics method Implement primitive CreateTopics and DeleteTopics methods May 13, 2024
.gitignore Outdated Show resolved Hide resolved
src/client.rs Outdated Show resolved Hide resolved
src/client.rs Outdated Show resolved Hide resolved
src/client.rs Outdated Show resolved Hide resolved
Copy link
Owner

@thedodd thedodd left a comment

Choose a reason for hiding this comment

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

Ping me once the rebase and such are g2g. Thanks Nick!

@ncalibey
Copy link
Contributor Author

@thedodd changes made. Only question I have is around the error type for if we get an error on the oneshot receiver. Should we just wrap it in a ClientError?

@thedodd
Copy link
Owner

thedodd commented May 17, 2024

@ncalibey yea, for the oneshot channels, we have the unpack_broker_response utility function which will handle that case. It maps to a ClientError::Other(_) in that case.

Comment on lines +543 to +555
return if let Some(leader) = &cluster.controller {
let uid = uuid::Uuid::new_v4();
leader.conn.delete_topics(uid, request, tx).await;
unpack_broker_response(rx).await.and_then(|(_, res)| {
if let ResponseKind::DeleteTopicsResponse(inner) = res {
Ok(inner)
} else {
Err(ClientError::MalformedResponse)
}
})
} else {
Err(ClientError::NoControllerFound)
};
Copy link
Owner

Choose a reason for hiding this comment

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

Nice! I like it.

@thedodd thedodd merged commit 44100cc into thedodd:main May 17, 2024
4 checks passed
@ncalibey ncalibey deleted the create-topics branch May 17, 2024 17:58
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