运行时
2025年8月17日小于 1 分钟hyperlanewebrustconfigruntime
提示
hyperlane
框架基于 tokio
,可以参考 tokio
官方文档 进行配置。
快速配置
#[tokio::main]
async fn main() {}
精细化配置
fn main() {
let thread_count: usize = get_thread_count();
let runtime: tokio::runtime::Runtime = tokio::runtime::Builder::new_multi_thread()
.worker_threads(thread_count)
.thread_stack_size(2097152)
.max_blocking_threads(5120)
.max_io_events_per_tick(5120)
.enable_all()
.build()
.unwrap();
runtime().block_on(async move {}).unwrap();
}