File: test_tokio_current_thread_run_forever.rs

package info (click to toggle)
rust-pyo3-async-runtimes 0.25.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 448 kB
  • sloc: makefile: 2
file content (16 lines) | stat: -rw-r--r-- 462 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
mod tokio_run_forever;

fn main() {
    pyo3::prepare_freethreaded_python();

    let mut builder = tokio::runtime::Builder::new_current_thread();
    builder.enable_all();

    pyo3_async_runtimes::tokio::init(builder);
    std::thread::spawn(move || {
        pyo3_async_runtimes::tokio::get_runtime().block_on(futures::future::pending::<()>());
    });

    tokio_run_forever::test_main();
    println!("test test_tokio_current_thread_run_forever ... ok");
}