open_oi_feed
parent
564cd63014
commit
733b58250f
|
@ -831,6 +831,31 @@ async def aio_open_interest_feed_relay(
|
||||||
await asyncio.sleep(float('inf'))
|
await asyncio.sleep(float('inf'))
|
||||||
|
|
||||||
|
|
||||||
|
@acm
|
||||||
|
async def open_oi_feed(
|
||||||
|
) -> to_asyncio.LinkedTaskChannel:
|
||||||
|
|
||||||
|
instruments: list[Symbol]
|
||||||
|
async with get_client(
|
||||||
|
) as client:
|
||||||
|
instruments = await client.get_instruments()
|
||||||
|
|
||||||
|
fh: FeedHandler
|
||||||
|
first: None
|
||||||
|
chan: to_asyncio.LinkedTaskChannel
|
||||||
|
async with (
|
||||||
|
maybe_open_feed_handler() as fh,
|
||||||
|
to_asyncio.open_channel_from(
|
||||||
|
partial(
|
||||||
|
aio_open_interest_feed_relay,
|
||||||
|
fh,
|
||||||
|
instruments
|
||||||
|
)
|
||||||
|
) as (first, chan)
|
||||||
|
):
|
||||||
|
yield chan
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# TODO, move all to `.broker` submod!
|
# TODO, move all to `.broker` submod!
|
||||||
# async def aio_order_feed_relay(
|
# async def aio_order_feed_relay(
|
||||||
|
|
Loading…
Reference in New Issue