Babylonia-terminal/babylonia_terminal_launcher/native/hub/src/lib.rs
2024-05-18 18:34:24 +02:00

28 lines
816 B
Rust
Executable File

//! This `hub` crate is the
//! entry point of the Rust logic.
// This `tokio` will be used by Rinf.
// You can replace it with the original `tokio`
// if you're not targeting the web.
use tokio_with_wasm::tokio;
mod config;
mod game_state;
mod messages;
rinf::write_interface!();
// Always use non-blocking async functions
// such as `tokio::fs::File::open`.
// If you really need to use blocking code,
// use `tokio::task::spawn_blocking`.
async fn main() {
// Repeat `tokio::spawn` anywhere in your code
// if more concurrent tasks are needed.
//tokio::spawn(sample_functions::tell_numbers());
//tokio::spawn(sample_functions::stream_fractal());
//tokio::spawn(sample_functions::run_debug_tests());
tokio::spawn(game_state::get_game_state());
tokio::spawn(config::get_config());
}