riverqueue / river

Fast and reliable background jobs in Go
https://riverqueue.com
Mozilla Public License 2.0
2.86k stars 68 forks source link

Add transaction-based variants for all queue functions #402

Closed brandur closed 3 weeks ago

brandur commented 3 weeks ago

I noticed while trying to write tests for River UI that it wasn't possible to use any of the queue endpoints with a test transaction because unlike functions Client.Insert which have a transaction based InsertTx variant, queue functions can only work on the main pool.

Here, add transaction variants for all queue functions:

brandur commented 3 weeks ago

@bgentry I was trying to write more tests for River UI endpoints, but found that since I was using test transactions, it wasn't possible to test the queue-related stuff because transaction-based functions were missing. Mind taking a look at this one?