fix : engine parallel workers
This commit is contained in:
@@ -4,7 +4,10 @@ import { isMultiThreadSupported, isWasmSupported } from "./shared";
|
||||
import { getEngineWorkers } from "./worker";
|
||||
|
||||
export class Stockfish17 {
|
||||
public static async create(lite?: boolean): Promise<UciEngine> {
|
||||
public static async create(
|
||||
lite?: boolean,
|
||||
workersNb?: number
|
||||
): Promise<UciEngine> {
|
||||
if (!Stockfish17.isSupported()) {
|
||||
throw new Error("Stockfish 17 is not supported");
|
||||
}
|
||||
@@ -20,7 +23,7 @@ export class Stockfish17 {
|
||||
? EngineName.Stockfish17Lite
|
||||
: EngineName.Stockfish17;
|
||||
|
||||
const workers = getEngineWorkers(enginePath);
|
||||
const workers = getEngineWorkers(enginePath, workersNb);
|
||||
|
||||
return UciEngine.create(engineName, workers);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user