Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.backend.python
Commits
f8eabdc4
Commit
f8eabdc4
authored
Jul 11, 2019
by
Samuel GAIST
Browse files
[execution][loop] Implement output setup and writing
parent
b554ed02
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/backend/python/execution/loop.py
View file @
f8eabdc4
...
...
@@ -48,7 +48,6 @@ import json
import
zmq
from
..algorithm
import
Algorithm
from
..baseformat
import
baseformat
from
..dataformat
import
DataFormat
from
..helpers
import
create_inputs_from_configuration
from
..helpers
import
create_outputs_from_configuration
...
...
@@ -209,6 +208,14 @@ class LoopExecutor(object):
databases
=
databases
,
)
self
.
output_list
,
_
=
create_outputs_from_configuration
(
self
.
data
,
self
.
algorithm
,
self
.
prefix
,
cache_root
,
input_list
=
self
.
input_list
,
)
self
.
message_handler
=
message_handler
self
.
message_handler
.
setup
(
self
.
algorithm
,
self
.
prefix
)
self
.
message_handler
.
set_executor
(
self
)
...
...
@@ -251,6 +258,14 @@ class LoopExecutor(object):
logger
.
debug
(
"User loop has validated: {}
\n
{}"
.
format
(
is_valid
,
answer
))
return
is_valid
,
answer
def
write
(
self
):
"""Write the loop output"""
retval
=
self
.
runner
.
write
(
self
.
output_list
)
logger
.
debug
(
"User loop wrote output: {}"
.
format
(
retval
))
return
retval
@
property
def
address
(
self
):
""" Address of the message handler"""
...
...
@@ -267,3 +282,9 @@ class LoopExecutor(object):
self
.
message_handler
.
join
()
self
.
message_handler
=
None
def
close
(
self
):
"""Close all outputs"""
for
output
in
self
.
output_list
:
output
.
close
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment