doobie
doobie copied to clipboard
New approach to PostgreSQL NOTIFY/LISTEN handling
(Issue added on request after Gitter question)
With the new 6.0-branch changes (running queries on different ExecutionContexts, cats-effect scheduling and timer changes) there might be a more elegant way to listen for and stream PostgreSQL notifications that do not rely on a burnerthread and Thread.sleep
calls.
All suggestions appreciated.
First improvement: replace HC.delay{ Thread.sleep(...) }
with timer.sleep(...).to[ConnectionIO]
(where timer is a Timer[IO]
, see cats-effect docs.). More suggestions welcome.