Skip to content

Commit d751c94

Browse files
committed
Add into_tokio_runtime
1 parent bddea95 commit d751c94

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/runtime.rs

+10
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,21 @@ impl Runtime {
109109
}
110110

111111
/// Access the options used to create this runtime
112+
///
113+
/// Warning: Not all options can be accessed in this way
114+
/// Extensions, for example, are consumed during runtime creation
112115
#[must_use]
113116
pub fn options(&self) -> &RuntimeOptions {
114117
&self.inner.options
115118
}
116119

120+
/// Destroy the v8 runtime, releasing all resources
121+
/// Then the internal tokio runtime will be returned
122+
#[must_use]
123+
pub fn into_tokio_runtime(self) -> Rc<tokio::runtime::Runtime> {
124+
self.tokio
125+
}
126+
117127
/// Run the JS event loop to completion
118128
/// Required when using the `_immediate` variants of functions
119129
///

0 commit comments

Comments
 (0)