Closed docteurklein closed 2 years ago
Seems like there wouldn't be a need for that if there was a withDequeue
operation running in Session
. Please consider reporting that to the maintainers of the queue package.
@jfischoff is that something that could be done in both hasql-queue and hasql-notifications?
withDequeue
could have a Session interface but it might give people the impression that you could use it in a transaction ... but you can't because of the use of notifications.
Why not just use Data.Pool
directly? It is nearly as easy to use as this library.
yes, maybe using Data.Pool is the solution for me. I tried already, but I kinda repeated the boilerplate that hasql-pool solved (I guess :)).
Concerning postgres notifications, they are supported in transactions; they are all released after commit (https://www.postgresql.org/docs/current/sql-notify.html#id-1.9.3.157.5) if that's what you meant?
Thanks for the answers :)
Ah right, I misremembered. The problem with withDequeue
in a transaction is it would keep the transaction open for a long time which is not a great practice.
This should be addressed by Session providing access to the connection via MonadReader now.
Hello :)
I hope this makes sense, but I'm desperately trying to use
hasql-queue
andhasql-notification
with a connection pool, like that: https://github.com/docteurklein/schloss/blob/7f03f734bccfa4632b422039113101db134a8c72/src/Main.hs#L140-L143Is that something I could do otherwise? Thanks, Florian.