import { UpdateChannelParams } from '@statechannels/client-api-schema' ; import P from 'pino' ; import { EngineConfig , MultipleChannelOutput , SingleChannelOutput } from '../types' ; import { SingleThreadedEngine } from '../engine' ; import { WorkerManager } from './manager' ; /**
 * A multi-threaded Nitro engine
 */ export class MultiThreadedEngine extends SingleThreadedEngine { private workerManager : WorkerManager ; public static async create ( engineConfig , logger ) { return new this ( engineConfig , logger ) ; } protected constructor ( private engineConfig , logger ) { super ( engineConfig , logger ) ; this . workerManager = new WorkerManager ( this . engineConfig , this . logger ) ; } async updateChannel ( args ) { return this . workerManager . updateChannel ( args ) ; } async pushMessage ( rawPayload ) { return this . workerManager . pushMessage ( rawPayload ) ; } async pushUpdate ( rawPayload ) { return this . workerManager . pushUpdate ( rawPayload ) ; } public async destroy ( ) { await this . workerManager . destroy ( ) ; await super . destroy ( ) ; } public async warmUpThreads ( ) { return this . workerManager . warmUpThreads ( ) ; } }