From 76c64dd94d25cd896c75bbe9d000aed7dfc33653 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 4 Jun 2018 22:32:57 +0200 Subject: messages from tasks --- app/relay/modules/test.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/relay/modules/test.js') diff --git a/app/relay/modules/test.js b/app/relay/modules/test.js index b0753f8..57a324a 100644 --- a/app/relay/modules/test.js +++ b/app/relay/modules/test.js @@ -17,6 +17,15 @@ const live = { type: 'python', script: 'test.py', live: true, + listen: (task, line, i) => { + if (line.match('orange')) { + return { type: 'progress', task, mode: 'orange', progress: i } + } + if ( (i % 10) === 9) { + return { type: 'epoch', task, epoch: (i/10)|0 } + } + return null + } } export default { -- cgit v1.2.3-70-g09d2