pub struct Pool { /* private fields */ }
Expand description

A process pool.

This works similar to spawn but lets you retain a pool of processes. Since procspawn is intended to isolate potentially crashing code the pool will automatically restart broken processes.

Note that it’s not possible to intercept streams of processes spawned through the pool.

When the process pool is dropped all processes are killed.

This requires the pool feature.

Implementations

Creates the default pool.

Creates a builder to customize pool creation.

Returns the size of the pool.

Returns the number of jobs waiting to executed in the pool.

Returns the number of currently active threads.

Spawns a closure into a process of the pool.

This works exactly like procspawn::spawn but instead of spawning a new process, it reuses a process from the pool.

Joins the process pool.

Joins and shuts down.

Hard kills all processes in the pool.

After calling this the pool cannot be used any more.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.