Lol, don't use `maybe_open_feed()` for now, it's totally borked...

pause_feeds_on_sym_switch
Tyler Goodlet 2021-08-18 14:46:13 -04:00
parent 2a9d24ccac
commit 2f1455d423
2 changed files with 13 additions and 5 deletions

View File

@ -32,7 +32,7 @@ import tractor
from ..log import get_logger from ..log import get_logger
from ..data._normalize import iterticks from ..data._normalize import iterticks
from ..data.feed import Feed, maybe_open_feed from ..data.feed import Feed, maybe_open_feed, open_feed
from .._daemon import maybe_spawn_brokerd from .._daemon import maybe_spawn_brokerd
from . import _paper_engine as paper from . import _paper_engine as paper
from ._messages import ( from ._messages import (
@ -958,13 +958,17 @@ async def _emsd_main(
# spawn one task per broker feed # spawn one task per broker feed
async with ( async with (
maybe_open_feed( open_feed(
# maybe_open_feed(
broker, broker,
[symbol], [symbol],
loglevel=loglevel, loglevel=loglevel,
) as (feed, stream), # ) as (feed, stream),
) as feed,
): ):
stream = feed.stream
# XXX: this should be initial price quote from target provider # XXX: this should be initial price quote from target provider
first_quote = feed.first_quote first_quote = feed.first_quote

View File

@ -177,11 +177,15 @@ async def cascade(
func: Callable = _fsps[fsp_func_name] func: Callable = _fsps[fsp_func_name]
# open a data feed stream with requested broker # open a data feed stream with requested broker
async with data.feed.maybe_open_feed( # async with data.feed.maybe_open_feed(
async with data.feed.open_feed(
brokername, brokername,
[symbol], [symbol],
shielded_stream=True, shielded_stream=True,
) as (feed, stream): # ) as (feed, stream):
) as feed:
stream = feed.stream
assert src.token == feed.shm.token assert src.token == feed.shm.token