From d4e36b1e55d4e9e774b1aed6b4968102bfaefbe1 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 17 Dec 2018 19:15:29 -0500 Subject: [PATCH] Jeeze, don't overwrite the payload for each channel... --- piker/brokers/data.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/piker/brokers/data.py b/piker/brokers/data.py index e449a770..b076ef9c 100644 --- a/piker/brokers/data.py +++ b/piker/brokers/data.py @@ -158,17 +158,14 @@ async def fan_out_to_chans( diff_cached=diff_cached, ): chan_payloads = {} - payload = {} for quote in quotes: - # is this too QT specific? - symbol = quote['symbol'] - payload[symbol] = quote # set symbol quotes for each subscriber - for chan, cid in symbols2chans.get(quote['key'], set()): + # for chan, cid in symbols2chans.get(quote['key'], set()): + for chan, cid in symbols2chans[quote['key']]: chan_payloads.setdefault( chan, - {'yield': payload, 'cid': cid} - ) + {'yield': {}, 'cid': cid} + )['yield'].update({quote['symbol']: quote}) # deliver to each subscriber (fan out) if chan_payloads: