From 4989850b969440bc22eb09fc68629f171a98fe62 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Thu, 11 Jul 2024 15:01:17 +0200 Subject: [PATCH] feat: added `RemoteProcess.isFinished` to allow tracking when streaming was completed --- src/activity/exe-unit/process.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/activity/exe-unit/process.ts b/src/activity/exe-unit/process.ts index 44c69d0a0..a7ef22b3d 100644 --- a/src/activity/exe-unit/process.ts +++ b/src/activity/exe-unit/process.ts @@ -95,4 +95,11 @@ export class RemoteProcess { this.subscription.add(() => end()); }); } + + /** + * Checks if the exe-script batch from Yagna has completed, reflecting all work and streaming to be completed + */ + isFinished() { + return this.lastResult?.isBatchFinished ?? false; + } }