@@ -220,22 +220,12 @@ publish_delivered(Msg, MsgProps, ChPid,
220220 State = # passthrough {bq = BQ , bqs = BQS }) ->
221221 ? passthrough2 (publish_delivered (Msg , MsgProps , ChPid , BQS )).
222222
223- % % TODO this is a hack. The BQ api does not give us enough information
224- % % here - if we had the Msg we could look at its priority and forward
225- % % to the appropriate sub-BQ. But we don't so we are stuck.
226- % %
227- % % But fortunately VQ ignores discard/4, so we can too, *assuming we
228- % % are talking to VQ*. discard/4 is used by HA, but that's "above" us
229- % % (if in use) so we don't break that either, just some hypothetical
230- % % alternate BQ implementation.
231- discard (_MsgId , _ChPid , State = # state {}) ->
232- State ;
233- % % We should have something a bit like this here:
234- % % pick1(fun (_P, BQSN) ->
235- % % BQ:discard(MsgId, ChPid, BQSN)
236- % % end, Msg, State);
237- discard (MsgId , ChPid , State = # passthrough {bq = BQ , bqs = BQS }) ->
238- ? passthrough1 (discard (MsgId , ChPid , BQS )).
223+ discard (Msg , ChPid , State = # state {bq = BQ }) ->
224+ pick1 (fun (_P , BQSN ) ->
225+ BQ :discard (Msg , ChPid , BQSN )
226+ end , Msg , State );
227+ discard (Msg , ChPid , State = # passthrough {bq = BQ , bqs = BQS }) ->
228+ ? passthrough1 (discard (Msg , ChPid , BQS )).
239229
240230drain_confirmed (State = # state {bq = BQ }) ->
241231 fold_append2 (fun (_P , BQSN ) -> BQ :drain_confirmed (BQSN ) end , State );
0 commit comments