Don't shield ems feed; enact remote cancels
parent
2046fe293a
commit
17d3e7a9e2
|
@ -268,6 +268,7 @@ async def exec_loop(
|
||||||
*trio.open_memory_channel(100),
|
*trio.open_memory_channel(100),
|
||||||
_buys={},
|
_buys={},
|
||||||
_sells={},
|
_sells={},
|
||||||
|
|
||||||
_reqids={},
|
_reqids={},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -284,22 +285,20 @@ async def exec_loop(
|
||||||
# return control to parent task
|
# return control to parent task
|
||||||
task_status.started((first_quote, feed, client))
|
task_status.started((first_quote, feed, client))
|
||||||
|
|
||||||
# shield this field so the remote brokerd does not get cancelled
|
|
||||||
stream = feed.stream
|
stream = feed.stream
|
||||||
with stream.shield():
|
async with trio.open_nursery() as n:
|
||||||
async with trio.open_nursery() as n:
|
n.start_soon(
|
||||||
n.start_soon(
|
execute_triggers,
|
||||||
execute_triggers,
|
broker,
|
||||||
broker,
|
symbol,
|
||||||
symbol,
|
stream,
|
||||||
stream,
|
ctx,
|
||||||
ctx,
|
client,
|
||||||
client,
|
book
|
||||||
book
|
)
|
||||||
)
|
|
||||||
|
|
||||||
if _exec_mode == 'paper':
|
if _exec_mode == 'paper':
|
||||||
n.start_soon(simulate_fills, stream.clone(), client)
|
n.start_soon(simulate_fills, stream.clone(), client)
|
||||||
|
|
||||||
|
|
||||||
# TODO: lots of cases still to handle
|
# TODO: lots of cases still to handle
|
||||||
|
|
Loading…
Reference in New Issue