mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-12 11:50:11 +08:00
Minor changes to Zipline for signals.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user