mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-11 12:00:50 +08:00
cancellation tweaks.
This commit is contained in:
@@ -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(
|
||||
@@ -532,6 +534,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
|
||||
|
||||
Reference in New Issue
Block a user