summaryrefslogtreecommitdiff
path: root/app/relay/modules
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-04 22:32:57 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-04 22:32:57 +0200
commit76c64dd94d25cd896c75bbe9d000aed7dfc33653 (patch)
tree71a394cc482baa5addb2ce0d9b81ee689227d41a /app/relay/modules
parentcfe98e6eef5ca24b5c2656fcda8e3fac71d55a1d (diff)
messages from tasks
Diffstat (limited to 'app/relay/modules')
-rw-r--r--app/relay/modules/samplernn.js7
-rw-r--r--app/relay/modules/test.js9
2 files changed, 14 insertions, 2 deletions
diff --git a/app/relay/modules/samplernn.js b/app/relay/modules/samplernn.js
index d3b5012..64a6b88 100644
--- a/app/relay/modules/samplernn.js
+++ b/app/relay/modules/samplernn.js
@@ -6,11 +6,14 @@ const cwd = process.env.SAMPLERNN_CWD || path.join(process.env.HOME, 'code/' + n
const fetch = {
type: 'perl',
script: 'get.pl',
- // here i need to bridge again... get the filename that comes back from youtube-dl
- // and tell the cortex that URL -> fn and add the filename!s
params: (task) => {
console.log(task)
return [ task.opt.url ]
+ },
+ listen: (task, line, i) => {
+ // here i need to bridge again... get the filename that comes back from youtube-dl
+ // and tell the cortex that URL -> fn and add the filename!s
+ return null
}
}
const train = {
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 {