Skip to main content

pool

Function pool 

Source
pub fn pool(capacity: isize) -> Pool
Available 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 the num_cpus crate, 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. Use pool(-1), for example, to fire off background async tasks while the main thread is doing more work.