of


Description:

public static Result<WorkerPool,Error> of (int poolSize)

Creates a thread pool with the specified number of worker threads.

Parameters:

poolSize

the number of worker threads (must be > 0).

Returns:

Result.ok(pool), or Result.error(WorkerPoolError.INVALID_ARGUMENT) when poolSize is not positive.