Open charles-cooper opened 6 years ago
Reading the implementation for withPayloadDB, https://github.com/jfischoff/postgresql-queue/blob/6a9c22055ae81e8dcaf5cfd60bcb640a4c512206/src/Database/PostgreSQL/Simple/Queue.hs#L227-L229, it looks like there is no strategy for backoff. Would it be better to implement some sort of backoff strategy within postgresql-simple-queue or do have a client-side implementation? E.g.
withPayloadDB
postgresql-simple-queue
forever $ do withPayloadDB "public" 5 $ \payload -> do tryProcessPayload sleep 10 -- or something more complicated based on `pModifiedAt` and `pAttempts`
Just saw this. Yeah retry with exponential backoff sounds like a improvement.
Reading the implementation for
withPayloadDB
, https://github.com/jfischoff/postgresql-queue/blob/6a9c22055ae81e8dcaf5cfd60bcb640a4c512206/src/Database/PostgreSQL/Simple/Queue.hs#L227-L229, it looks like there is no strategy for backoff. Would it be better to implement some sort of backoff strategy withinpostgresql-simple-queue
or do have a client-side implementation? E.g.