Encode a `mktpair` field if passed in msg by caller

pre_overruns_ctxcancelled
Tyler Goodlet 2023-03-20 21:55:39 -04:00
parent bd73ec4ea4
commit 4cfe13756b
1 changed files with 6 additions and 1 deletions

View File

@ -32,6 +32,7 @@ import pendulum
import numpy as np import numpy as np
from ..accounting._mktinfo import ( from ..accounting._mktinfo import (
MktPair,
Symbol, Symbol,
) )
from .types import Struct from .types import Struct
@ -90,7 +91,7 @@ class Flume(Struct):
queuing properties. queuing properties.
''' '''
symbol: Symbol symbol: Symbol | MktPair
first_quote: dict first_quote: dict
_rt_shm_token: _Token _rt_shm_token: _Token
@ -178,7 +179,11 @@ class Flume(Struct):
# TODO: do we even need to convert to dict # TODO: do we even need to convert to dict
# first now? # first now?
# TODO: drop the former.
msg['symbol'] = msg['symbol'].to_dict() msg['symbol'] = msg['symbol'].to_dict()
mktpair = msg.get('mktpair')
if mktpair:
msg['mktpair'] = mktpair.to_dict()
# can't serialize the stream or feed objects, it's expected # can't serialize the stream or feed objects, it's expected
# you'll have a ref to it since this msg should be rxed on # you'll have a ref to it since this msg should be rxed on