@@ -249,22 +249,12 @@ batch_publish_delivered(Publishes, ChPid, Flow,
249249 State = # passthrough {bq = BQ , bqs = BQS }) ->
250250 ? passthrough2 (batch_publish_delivered (Publishes , ChPid , Flow , BQS )).
251251
252- % % TODO this is a hack. The BQ api does not give us enough information
253- % % here - if we had the Msg we could look at its priority and forward
254- % % to the appropriate sub-BQ. But we don't so we are stuck.
255- % %
256- % % But fortunately VQ ignores discard/4, so we can too, *assuming we
257- % % are talking to VQ*. discard/4 is used by HA, but that's "above" us
258- % % (if in use) so we don't break that either, just some hypothetical
259- % % alternate BQ implementation.
260- discard (_MsgId , _ChPid , _Flow , State = # state {}) ->
261- State ;
262- % % We should have something a bit like this here:
263- % % pick1(fun (_P, BQSN) ->
264- % % BQ:discard(MsgId, ChPid, Flow, BQSN)
265- % % end, Msg, State);
266- discard (MsgId , ChPid , Flow , State = # passthrough {bq = BQ , bqs = BQS }) ->
267- ? passthrough1 (discard (MsgId , ChPid , Flow , BQS )).
252+ discard (Msg , ChPid , Flow , State = # state {bq = BQ }) ->
253+ pick1 (fun (_P , BQSN ) ->
254+ BQ :discard (Msg , ChPid , Flow , BQSN )
255+ end , Msg , State );
256+ discard (Msg , ChPid , Flow , State = # passthrough {bq = BQ , bqs = BQS }) ->
257+ ? passthrough1 (discard (Msg , ChPid , Flow , BQS )).
268258
269259drain_confirmed (State = # state {bq = BQ }) ->
270260 fold_append2 (fun (_P , BQSN ) -> BQ :drain_confirmed (BQSN ) end , State );
0 commit comments