You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "CTTY (via GitHub)" <gi...@apache.org> on 2026/05/01 00:22:05 UTC
Re: [PR] feat!(runtime): Support custom Runtime in Catalog [iceberg-rust]
CTTY commented on code in PR #2308:
URL: https://github.com/apache/iceberg-rust/pull/2308#discussion_r3171520784
##########
crates/iceberg/src/runtime/mod.rs:
##########
@@ -39,37 +43,245 @@ impl<T: Send + 'static> Future for JoinHandle<T> {
}
}
-#[allow(dead_code)]
-pub fn spawn<F>(f: F) -> JoinHandle<F::Output>
-where
- F: std::future::Future + Send + 'static,
- F::Output: Send + 'static,
-{
- JoinHandle(task::spawn(f))
+/// Handle to a single tokio runtime. Holds an optional `Arc` to keep the
+/// runtime alive when we own it, and a `Handle` for spawning.
+#[derive(Clone)]
+pub struct RuntimeHandle {
+ /// Keeps the tokio runtime alive when we own it (`Runtime::new`).
+ /// `None` when borrowing an existing runtime via `Handle::try_current()`.
+ _owned: Option<Arc<tokio::runtime::Runtime>>,
Review Comment:
I think this makes sense, users should be responsible for managing the lifetime their own runtime
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org