@@ -42,6 +42,8 @@ impl PyRuntimeErrorExt for PyRuntimeError {
42
42
43
43
use once_cell:: sync:: { Lazy , OnceCell } ;
44
44
45
+ use crate :: dataframe:: PyRecording ;
46
+
45
47
// The bridge needs to have complete control over the lifetimes of the individual recordings,
46
48
// otherwise all the recording shutdown machinery (which includes deallocating C, Rust and Python
47
49
// data and joining a bunch of threads) can end up running at any time depending on what the
@@ -172,6 +174,7 @@ fn rerun_bindings(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
172
174
m. add_function ( wrap_pyfunction ! ( log_file_from_contents, m) ?) ?;
173
175
m. add_function ( wrap_pyfunction ! ( send_arrow_chunk, m) ?) ?;
174
176
m. add_function ( wrap_pyfunction ! ( send_blueprint, m) ?) ?;
177
+ m. add_function ( wrap_pyfunction ! ( send_recording, m) ?) ?;
175
178
176
179
// misc
177
180
m. add_function ( wrap_pyfunction ! ( version, m) ?) ?;
@@ -1341,6 +1344,23 @@ fn send_blueprint(
1341
1344
}
1342
1345
}
1343
1346
1347
+ /// Send all chunks from a [`PyRecording`] to the given recording stream.
1348
+ ///
1349
+ /// .. warning::
1350
+ /// ⚠️ This API is experimental and may change or be removed in future versions! ⚠️
1351
+ #[ pyfunction]
1352
+ #[ pyo3( signature = ( rrd, recording = None ) ) ]
1353
+ fn send_recording ( rrd : & PyRecording , recording : Option < & PyRecordingStream > ) {
1354
+ let Some ( recording) = get_data_recording ( recording) else {
1355
+ return ;
1356
+ } ;
1357
+
1358
+ let store = rrd. store . read ( ) ;
1359
+ for chunk in store. iter_chunks ( ) {
1360
+ recording. send_chunk ( ( * * chunk) . clone ( ) ) ;
1361
+ }
1362
+ }
1363
+
1344
1364
// --- Misc ---
1345
1365
1346
1366
/// Return a verbose version string.
@@ -1471,7 +1491,7 @@ fn send_recording_start_time_nanos(
1471
1491
1472
1492
// --- Helpers ---
1473
1493
1474
- fn python_version ( py : Python < ' _ > ) -> re_log_types:: PythonVersion {
1494
+ pub fn python_version ( py : Python < ' _ > ) -> re_log_types:: PythonVersion {
1475
1495
let py_version = py. version_info ( ) ;
1476
1496
re_log_types:: PythonVersion {
1477
1497
major : py_version. major ,
0 commit comments