better api usability

This commit is contained in:
Nikolay Kim 2021-12-03 01:34:41 +06:00
parent 79afb61b03
commit d89f1c29c6
5 changed files with 91 additions and 27 deletions

View file

@ -655,11 +655,11 @@ fn pool() {
async fn pool_usage() {
use ntex::{time, util};
PoolId::set_spawn_fn(|f| {
PoolId::set_spawn_fn_all(|f| {
let _ = ntex::rt::spawn(f);
});
let p_ref = PoolId::P1.pool_ref().set_pool_size(10 * 1024);
let p_ref = PoolId::P1.set_pool_size(10 * 1024);
let p1 = p_ref.pool();
let p2 = p_ref.pool();