Skip to content

Commit a6c10ae

Browse files
authored
Call each different news handler once (#694)
* Call each different news handler once * if instead of get default
1 parent a7e23c6 commit a6c10ae

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

alpaca_trade_api/stream.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,15 +573,15 @@ async def _dispatch(self, msg):
573573
if not symbols:
574574
symbols.append('*')
575575

576+
handlers = set()
576577
for symbol in symbols:
577578
handler = self._handlers['news'].get(symbol)
578579
if handler is None:
579580
handler = self._handlers['news'].get('*')
580-
581581
if handler is not None:
582-
await handler(self._cast(msg_type, msg))
583-
# For a single message, only call the handler once
584-
break
582+
handlers.add(handler)
583+
for handler in handlers:
584+
await handler(self._cast(msg_type, msg))
585585
else:
586586
await super()._dispatch(msg)
587587

0 commit comments

Comments
 (0)