pub fn pool(capacity: isize) -> PoolAvailable on crate feature
coroutine only.Expand description
Create a new Pool.
- If
capacity > 0, then the pool will be created with literally that number of permits (concurrency) available. - If
capacity = 0, then the pool will be created with the number of logical processors on the system using thenum_cpuscrate, minimum 1. - if
capacity < 0, then the pool will be created with the number of logical processors on the system, minus the specified amount, and minimum 1. Usepool(-1), for example, to fire off background async tasks while the main thread is doing more work.