| 745 | } |
| 746 | |
| 747 | fn main() { |
| 748 | let worker = std::thread::Builder::new() |
| 749 | .stack_size(16 * 1024 * 1024) |
| 750 | .spawn(|| { |
| 751 | let runtime = tokio::runtime::Builder::new_multi_thread() |
| 752 | .enable_all() |
| 753 | .build() |
| 754 | .expect("failed to build tokio runtime"); |
| 755 | runtime.block_on(run_cli()) |
| 756 | }) |
| 757 | .expect("failed to spawn bitfun-cli worker thread"); |
| 758 | |
| 759 | match worker.join() { |
| 760 | Ok(Ok(())) => {} |
| 761 | Ok(Err(err)) => { |
| 762 | eprintln!("Error: {err}"); |
| 763 | std::process::exit(1); |
| 764 | } |
| 765 | Err(_) => { |
| 766 | eprintln!("Error: bitfun-cli worker thread panicked"); |
| 767 | std::process::exit(1); |
| 768 | } |
| 769 | } |
| 770 | } |