Bogdanp/dramatiq
Feature Request: Considering handling a SkipEnqueue MiddlewareError
開放
#276 建立於 2020年2月26日
enhancementhelp wanted
倉庫指標
- 星標
- (3,884 顆星)
- PR 合併指標
- (PR 指標待抓取)
描述
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.