Skip to main content

parallelHandSimulationAsync

parallelHandSimulationAsync(holeCards: CardInput, board: CardInput, numSimulations: number, baseSeed: number, villains: number, numThreads: number, options?: AsyncOptions): Promise<number>

Import

const poker = require('poker-calculations');

ESM (Node):

import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const poker = require('poker-calculations');

When to use

Non-blocking version of parallelHandSimulation. Optional AsyncOptions cancel long runs via AbortSignal.

How to use

const poker = require('poker-calculations');

const eq = await poker.parallelHandSimulationAsync(hole, board, 20_000, 99, 1, 4);

const ac = new AbortController();
const pending = poker.parallelHandSimulationAsync(hole, board, 500_000, 99, 1, 4, {
signal: ac.signal,
});
// ac.abort(); // Promise rejects with AbortError

See also

parallelHandSimulation · AsyncOptions