AndreaBozzo commented on code in PR #257:
URL: https://github.com/apache/fluss-rust/pull/257#discussion_r2772880836
##########
bindings/cpp/src/lib.rs:
##########
@@ -825,6 +827,28 @@ impl LogScanner {
self.do_subscribe(Some(partition_id), bucket_id, start_offset)
}
+ fn unsubscribe_partition(&self, partition_id: PartitionId, bucket_id: i32)
-> ffi::FfiResult {
+ if let Some(ref inner) = self.inner {
+ match RUNTIME
+ .block_on(async { inner.unsubscribe_partition(partition_id,
bucket_id).await })
+ {
+ Ok(_) => ok_result(),
+ Err(e) => err_result(1, e.to_string()),
+ }
+ } else if let Some(ref inner_batch) = self.inner_batch {
+ match RUNTIME.block_on(async {
+ inner_batch
+ .unsubscribe_partition(partition_id, bucket_id)
+ .await
+ }) {
+ Ok(_) => ok_result(),
+ Err(e) => err_result(1, e.to_string()),
+ }
+ } else {
+ err_result(1, "LogScanner not initialized".to_string())
+ }
+ }
+
Review Comment:
i cheked `subscribe partition` delegates to the consolidated do_subscribe
helper. Maybe we can plan a similar helper going forward?
this LGTM tho and its not strictly needed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]