Bogdanp/dramatiq

Feature Request: Considering handling a SkipEnqueue MiddlewareError

オープン

#276 opened on 2020/02/26

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)Python (277 件のフォーク)batch import
enhancementhelp wanted

Repository metrics

Stars
 (3,884 個のスター)
PR merge metrics
 (平均マージ 20d 20h) (30d で 10 merged PRs)

説明

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:

  1. Define a SkipEnqueue(MiddlewareError).
  2. try...except this error around self.emit_before here, so a middleware could be given the possibility to interrupt an enqueuing in that hook?

Thanks.

コントリビューターガイド