Bogdanp/dramatiq
Feature Request: Considering handling a SkipEnqueue MiddlewareError
Aperta
#276 aperta il 26 feb 2020
enhancementhelp wanted
Metriche repository
- Star
- (3884 stelle)
- Metriche merge PR
- (Merge medio 20g 20h) (10 PR mergiate in 30 g)
Descrizione
I've just implemented a "DedupMiddleware" which can be used prevent a message from being enqueued if a similar message already exists in the queue.
Unfortunately it requires to override RedisBroker.enqueue() in order to gracefully catch the SkipEnqueue middleware error I raise when needed.
Would you consider accepting a PR that would:
- Define a
SkipEnqueue(MiddlewareError). try...exceptthis error around self.emit_before here, so a middleware could be given the possibility to interrupt an enqueuing in that hook?
Thanks.