Expand description
§基于Future(MVP),用于为外部提供基础的通用异步运行时和工具
§主要特征
§Examples
本地异步运行时:
use pi_async::rt::{AsyncRuntime, AsyncRuntimeExt, serial_local_thread::{LocalTaskRunner, LocalTaskRuntime}};
let rt = LocalTaskRunner::<()>::new().into_local();
let _ = rt.block_on(async move {});
多线程异步运行时使用:
use pi_async::prelude::{MultiTaskRuntime, MultiTaskRuntimeBuilder, StealableTaskPool};
use pi_async::rt::AsyncRuntimeExt;
let pool = StealableTaskPool::with(4,100000,[1, 254],3000);
let builer = MultiTaskRuntimeBuilder::new(pool)
.set_timer_interval(1)
.init_worker_size(4)
.set_worker_limit(4, 4);
let rt = builer.build();
let _ = rt.spawn(async move {});
§Features
serial
: 用于开启单线程顺序任务