updates for algo proxy.

This commit is contained in:
fawce
2012-03-08 17:37:15 -05:00
parent 3c0abbf946
commit f4bc73b738
2 changed files with 10 additions and 5 deletions
+7 -3
View File
@@ -28,7 +28,9 @@ class TradeSimulationClient(qmsg.Component):
#next feed event
socks = dict(self.poll.poll(self.heartbeat_timeout))
if self.result_feed in socks and socks[self.result_feed] == self.zmq.POLLIN:
if self.result_feed in socks and \
socks[self.result_feed] == self.zmq.POLLIN:
msg = self.result_feed.recv()
if msg == str(zp.CONTROL_PROTOCOL.DONE):
@@ -61,7 +63,8 @@ class OrderDataSource(qmsg.DataSource):
def __init__(self, simulation_dt):
"""
:param simulation_time: datetime in UTC timezone, sets the start time of simulation. orders
:param simulation_time: datetime in UTC timezone, sets the start
time of simulation. orders
will be timestamped relative to this datetime.
event = {
'sid' : an integer for security id,
@@ -129,7 +132,8 @@ class OrderDataSource(qmsg.DataSource):
count += 1
self.sent_count += 1
#TODO: we have to send at least one dummy order per do_work iteration or the feed will block waiting for our messages.
#TODO: we have to send at least one dummy order per do_work iteration
# or the feed will block waiting for our messages.
if(count == 0):
self.send_dummy()
self.sent_count += 1
+3 -2
View File
@@ -384,7 +384,8 @@ class MergedParallelBuffer(ParallelBuffer):
def append(self, event):
"""
:param event: a namedict with one entry. key is the name of the transform, value is the transformed value.
:param event: a namedict with one entry. key is the name of the
transform, value is the transformed value.
Add an event to the buffer for the source specified by
source_id.
"""
@@ -398,7 +399,7 @@ class BaseTransform(Component):
Top level execution entry point for the transform
- connects to the feed socket to subscribe to events
- connets to the result socket (most oftened bound by a TransformsMerge) to PUSH transforms
- connects to the result socket (most oftened bound by a TransformsMerge) to PUSH transforms
- processes all messages received from feed, until DONE message received
- pushes all transforms
- sends DONE to result socket, closes all sockets and context