Remove needless setup work.
This commit is contained in:
parent
99b9abf052
commit
dd03183022
|
@ -691,17 +691,15 @@ class ExternalContext(object):
|
||||||
if hasattr(klass, '__module__'):
|
if hasattr(klass, '__module__'):
|
||||||
klass.__module__ = 'econtext.core'
|
klass.__module__ = 'econtext.core'
|
||||||
|
|
||||||
def _reap_first_stage(self):
|
|
||||||
os.wait()
|
|
||||||
os.dup2(100, 0)
|
|
||||||
os.close(100)
|
|
||||||
|
|
||||||
def _setup_master(self, key):
|
def _setup_master(self, key):
|
||||||
|
os.wait() # Reap first stage.
|
||||||
|
|
||||||
self.broker = Broker()
|
self.broker = Broker()
|
||||||
self.context = Context(self.broker, 'master', key=key)
|
self.context = Context(self.broker, 'master', key=key)
|
||||||
self.channel = Channel(self.context, CALL_FUNCTION)
|
self.channel = Channel(self.context, CALL_FUNCTION)
|
||||||
self.context.stream = Stream(self.context)
|
self.context.stream = Stream(self.context)
|
||||||
self.context.stream.accept(0, 1)
|
self.context.stream.accept(100, 1)
|
||||||
|
os.close(100)
|
||||||
|
|
||||||
def _setup_logging(self, log_level):
|
def _setup_logging(self, log_level):
|
||||||
logging.basicConfig(level=log_level)
|
logging.basicConfig(level=log_level)
|
||||||
|
@ -743,7 +741,6 @@ class ExternalContext(object):
|
||||||
self.context.enqueue(reply_to, CallError(e))
|
self.context.enqueue(reply_to, CallError(e))
|
||||||
|
|
||||||
def main(self, key, log_level):
|
def main(self, key, log_level):
|
||||||
self._reap_first_stage()
|
|
||||||
self._setup_package()
|
self._setup_package()
|
||||||
self._setup_master(key)
|
self._setup_master(key)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue