Merge branch 'byebye_threadsim' of github.com:quantopian/zipline into byebye_threadsim

This commit is contained in:
scottsanderson
2012-07-27 19:43:10 -04:00
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import time
import itertools
import logbook
from setproctitle import setproctitle
from signal import SIGHUP, SIGINT
from signal import SIGHUP, SIGINT, SIGKILL, signal
from collections import OrderedDict, Counter
+10
View File
@@ -129,6 +129,8 @@ from utils.date_utils import EPOCH, UN_EPOCH, epoch_now
# Control Protocol
# -----------------------
PRODUCTION_PREFIXES = ['PERF', 'RISK', 'EXCEPTION', 'CANCEL']
INVALID_CONTROL_FRAME = FrameExceptionFactory('CONTROL')
CONTROL_STATES = Enum(
@@ -536,6 +538,14 @@ def EXCEPTION_FRAME(exception_tb):
return BT_UPDATE_FRAME('EXCEPTION', result)
def CANCEL_FRAME(date):
result = {
'date' : EPOCH(date)
}
return BT_UPDATE_FRAME('CANCEL', result)
def BT_UPDATE_FRAME(prefix, payload):
"""
Frames prepared by RISK_FRAME and PERF_FRAME methods are sent via the same