src/master/pool.ts
File pool.ts
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import DebugLogger from "debug"
import { multicast, Observable, Subject } from "observable-fns"
import { allSettled } from "../ponyfills"
import { defaultPoolSize } from "./implementation"
import {
Function queue
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public queue(taskFunction: TaskRunFunction<ThreadType, any>) {
const { maxQueuedJobs = Infinity } = this.options
if (this.isClosing) {
throw Error(`Cannot schedule pool tasks after terminate() has been called.`)
Function settled
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async settled(allowResolvingImmediately: boolean = false): Promise<Error[]> {
const getCurrentlyRunningTasks = () => flatMap(this.workers, worker => worker.runningTasks)
const taskFailures: Error[] = []