Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Alain Shakour
clowdflows
Commits
157103d8
Commit
157103d8
authored
Mar 25, 2015
by
Janez K
Browse files
celery inside engine
parent
64602efe
Changes
2
Hide whitespace changes
Inline
Side-by-side
workflows/engine.py
View file @
157103d8
import
workflows.library
import
time
import
random
from
workflows.tasks
import
*
class
WidgetRunner
():
def
__init__
(
self
,
widget
,
workflow_runner
,
standalone
=
False
):
...
...
@@ -31,12 +32,20 @@ class WidgetRunner():
if
self
.
widget
.
abstract_widget
.
wsdl
!=
''
:
input_dict
[
'wsdl'
]
=
self
.
widget
.
abstract_widget
.
wsdl
input_dict
[
'wsdl_method'
]
=
self
.
widget
.
abstract_widget
.
wsdl_method
if
self
.
widget
.
abstract_widget
.
has_progress_bar
:
outputs
=
function_to_call
(
input_dict
,
self
.
widget
)
elif
self
.
widget
.
abstract_widget
.
is_streaming
:
outputs
=
function_to_call
(
input_dict
,
self
.
widget
,
None
)
if
self
.
abstract_widget
.
windows_queue
and
settings
.
USE_WINDOWS_QUEUE
:
if
self
.
widget
.
abstract_widget
.
has_progress_bar
:
outputs
=
executeWidgetFunction
.
apply_async
([
self
.
widget
,
input_dict
],
queue
=
"windows"
).
wait
()
elif
self
.
widget
.
abstract_widget
.
is_streaming
:
outputs
=
executeWidgetProgressBar
.
apply_async
([
self
.
widget
,
input_dict
],
queue
=
"windows"
).
wait
()
else
:
outputs
=
executeWidgetStreaming
.
apply_async
([
self
.
widget
,
input_dict
],
queue
=
"windows"
).
wait
()
else
:
outputs
=
function_to_call
(
input_dict
)
if
self
.
widget
.
abstract_widget
.
has_progress_bar
:
outputs
=
function_to_call
(
input_dict
,
self
.
widget
)
elif
self
.
widget
.
abstract_widget
.
is_streaming
:
outputs
=
function_to_call
(
input_dict
,
self
.
widget
,
None
)
else
:
outputs
=
function_to_call
(
input_dict
)
else
:
""" we run the subprocess """
self
.
inner_workflow_runner
=
WorkflowRunner
(
self
.
widget
.
workflow_link
,
parent
=
self
.
workflow_runner
)
...
...
workflows/tasks.py
View file @
157103d8
...
...
@@ -48,4 +48,4 @@ def runWidgetAsync(widget):
def
runTest
(
return_string
):
import
time
time
.
sleep
(
3.2
)
return
return_string
\ No newline at end of file
return
return_string
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment