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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to