aboutsummaryrefslogtreecommitdiffstats
path: root/vicn/core/task.py
diff options
context:
space:
mode:
Diffstat (limited to 'vicn/core/task.py')
-rw-r--r--vicn/core/task.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/vicn/core/task.py b/vicn/core/task.py
index 53321972..8346c65e 100644
--- a/vicn/core/task.py
+++ b/vicn/core/task.py
@@ -219,6 +219,14 @@ class PythonTask(Task):
fut = loop.run_in_executor(None, partial)
fut.add_done_callback(self._done_callback)
+ def execute_blocking(self, *args, **kwargs):
+ all_args = self._args + args
+ all_kwargs = dict()
+ all_kwargs.update(self._kwargs)
+ all_kwargs.update(kwargs)
+
+ return self._func(*all_args, **all_kwargs)
+
def __repr__(self):
s = _get_func_desc(self._func)
return '<Task[py] {}>'.format(s) if s else '<Task[py]>'