From 3fc74ca7fca9d50695be87a9dcdeac98bd9db29c Mon Sep 17 00:00:00 2001 From: spalger Date: Tue, 19 May 2020 14:28:36 -0700 Subject: [PATCH] use ParentMsgs helpers --- packages/kbn-optimizer/src/optimizer/observe_worker.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/kbn-optimizer/src/optimizer/observe_worker.ts b/packages/kbn-optimizer/src/optimizer/observe_worker.ts index 1bf19f14d3b04..90c53f1ef9e87 100644 --- a/packages/kbn-optimizer/src/optimizer/observe_worker.ts +++ b/packages/kbn-optimizer/src/optimizer/observe_worker.ts @@ -24,10 +24,12 @@ import { inspect } from 'util'; import * as Rx from 'rxjs'; import { map, filter, takeUntil } from 'rxjs/operators'; -import { isWorkerMsg, isWorkerPing, WorkerConfig, WorkerMsg, Bundle } from '../common'; +import { isWorkerMsg, isWorkerPing, WorkerConfig, WorkerMsg, Bundle, ParentMsgs } from '../common'; import { OptimizerConfig } from './optimizer_config'; +const parentMsgs = new ParentMsgs(); + export interface WorkerStdio { type: 'worker stdio'; stream: 'stdout' | 'stderr'; @@ -152,8 +154,7 @@ export function observeWorker( return true; } - const pong: WorkerPongMsg = { type: 'pong' }; - proc.send(pong); + proc.send(parentMsgs.pong()); return false; }),