Minor changes to Zipline for signals.

This commit is contained in:
Stephen Diehl
2012-07-12 16:56:39 -04:00
parent 0342ee7f62
commit 4981b600f0
3 changed files with 17 additions and 11 deletions
+5
View File
@@ -92,6 +92,10 @@ class ComponentHost(object):
def unregister_component(self, component_id):
del self.components[component_id]
@property
def pids(self):
return [proc.pid for proc in self.subprocesses]
def open(self):
assert hasattr(self, 'zmq_flavor'), \
""" You must specify a flavor of ZeroMQ for all Topology
@@ -111,6 +115,7 @@ class ComponentHost(object):
for component in self.components.itervalues():
self.launch_component(component)
def is_running(self):
"""
DEPRECATED, left in for compatability for now.
+1 -1
View File
@@ -43,7 +43,7 @@ log = logbook.Logger('Controller')
# the system.
PARAMETERS = ndict(dict(
GENERATIONAL_PERIOD = 1,
GENERATIONAL_PERIOD = 8,
ALLOWED_SKIPPED_HEARTBEATS = 3,
ALLOWED_INVALID_HEARTBEATS = 3,
PRESTART_HEARBEATS = 3,
+11 -10
View File
@@ -399,16 +399,17 @@ class SimulatedTrading(object):
# the supervisory layer
# TODO: better way of identifying concurrency substrate
if self.sim.zmq_flavor == 'thread':
log.debug('Blocking')
for thread in self.sim.subthreads:
#log.debug('Waiting on %r' % thread)
log.debug('Waiting on %r' % thread)
thread.join()
log.debug('Yielded on %r' % thread)
else:
for process in self.sim.subprocesses:
process.join()
if blocking:
if self.sim.zmq_flavor == 'thread':
log.debug('Blocking')
for thread in self.sim.subthreads:
#log.debug('Waiting on %r' % thread)
log.debug('Waiting on %r' % thread)
thread.join()
log.debug('Yielded on %r' % thread)
else:
for process in self.sim.subprocesses:
process.join()
@property
def is_success(self):