Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.backend.python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
beat
beat.backend.python
Commits
f8eabdc4
Commit
f8eabdc4
authored
5 years ago
by
Samuel GAIST
Browse files
Options
Downloads
Patches
Plain Diff
[execution][loop] Implement output setup and writing
parent
b554ed02
No related branches found
No related tags found
1 merge request
!54
Implement loop output
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/backend/python/execution/loop.py
+22
-1
22 additions, 1 deletion
beat/backend/python/execution/loop.py
with
22 additions
and
1 deletion
beat/backend/python/execution/loop.py
+
22
−
1
View file @
f8eabdc4
...
@@ -48,7 +48,6 @@ import json
...
@@ -48,7 +48,6 @@ import json
import
zmq
import
zmq
from
..algorithm
import
Algorithm
from
..algorithm
import
Algorithm
from
..baseformat
import
baseformat
from
..dataformat
import
DataFormat
from
..dataformat
import
DataFormat
from
..helpers
import
create_inputs_from_configuration
from
..helpers
import
create_inputs_from_configuration
from
..helpers
import
create_outputs_from_configuration
from
..helpers
import
create_outputs_from_configuration
...
@@ -209,6 +208,14 @@ class LoopExecutor(object):
...
@@ -209,6 +208,14 @@ class LoopExecutor(object):
databases
=
databases
,
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
=
message_handler
self
.
message_handler
.
setup
(
self
.
algorithm
,
self
.
prefix
)
self
.
message_handler
.
setup
(
self
.
algorithm
,
self
.
prefix
)
self
.
message_handler
.
set_executor
(
self
)
self
.
message_handler
.
set_executor
(
self
)
...
@@ -251,6 +258,14 @@ class LoopExecutor(object):
...
@@ -251,6 +258,14 @@ class LoopExecutor(object):
logger
.
debug
(
"
User loop has validated: {}
\n
{}
"
.
format
(
is_valid
,
answer
))
logger
.
debug
(
"
User loop has validated: {}
\n
{}
"
.
format
(
is_valid
,
answer
))
return
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
@property
def
address
(
self
):
def
address
(
self
):
"""
Address of the message handler
"""
"""
Address of the message handler
"""
...
@@ -267,3 +282,9 @@ class LoopExecutor(object):
...
@@ -267,3 +282,9 @@ class LoopExecutor(object):
self
.
message_handler
.
join
()
self
.
message_handler
.
join
()
self
.
message_handler
=
None
self
.
message_handler
=
None
def
close
(
self
):
"""
Close all outputs
"""
for
output
in
self
.
output_list
:
output
.
close
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment