Skip to content
Browse files

Run Pyon spawn_process calls in a greenlet

  • Loading branch information...
1 parent 8390c52 commit bb4ba9f44963e1df0a789c1ec7176bb8faf6faa2 @oldpatricka oldpatricka committed Oct 9, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 pidantic/pyon/pyon.py
View
10 pidantic/pyon/pyon.py
@@ -6,12 +6,14 @@
from imp import load_source
from urllib import urlretrieve
from uuid import uuid4
+from gevent import spawn
from eeagent.util import unmake_id
from pidantic.pyon.persistence import PyonDataObject, PyonProcDataObject
from pidantic.pidantic_exceptions import PIDanticUsageException, PIDanticExecutionException
+
def proc_manager_lock(func):
def call(self, *args, **kwargs):
@@ -89,8 +91,14 @@ def create_process_db(self, **kwargs):
return process_object
@proc_manager_lock
- def run_process(self, process_object):
+ def run_process(self, process_object, async=True):
+
+ if async:
+ spawn(self._run_process, process_object)
+ else:
+ return self._run_process(process_object)
+ def _run_process(self, process_object):
try:
config = yaml.load(process_object.config)
except AttributeError:

0 comments on commit bb4ba9f

Please sign in to comment.
Something went wrong with that request. Please try again.