feat: 다중 시장 병렬 처리 (현재 순차 처리로 시장 간 지연 발생) #401
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
문제 요약
한국 시장(KRX)과 미국 시장이 동시에 활성일 때(KST 10:00-15:30) 시장 간 처리가 순차적으로 이루어져 각 시장의 실시간성이 저하됨.
현재 구조
KR + US_NASDAQ + US_NYSE + US_AMEX가 동시에 활성이면 4개 시장을 한 루프에서 순차 처리.
한국 종목 처리 중에는 미국 종목이 대기 상태가 됨.
시간대 중복 현황
기대 동작
각 시장을 **독립 태스크(asyncio.gather 또는 asyncio.create_task)**로 병렬 실행.
고려사항
_market_states,playbooks,active_stocks,last_scan_time) 동시 접근 시 race condition 방지 필요관련 파일
src/main.py(L4153-4500, realtime 루프 전체)연관 이슈
회로 차단기가 어떤건지 어떨때 동작하는지는 모르겠지만, 시장마다 별개여야 하지 않을까?