Best option for low level Postgres connection without tokio or async #4418
-
My application should use Postgres for coordinating a handful of workers (crawlers). Thus I want to use Postgres LISTEN and NOTIFY function. And I don't want anything async or tokio near my application (mainly due to missing async drop). Right now I consider my options: a) Copy pgconnection and other diesel files in my application and add LISTEN/NOTIFY support. Right now I believe that option a) would be the simplest one. Would you be interested to actually move a low-level postgres library out of Diesel and use it as a Diesel dependency? @weiznich wrote, that libpq is used by diesel also for performance reasons. Is it so that libpq would be expected be faster than something based on pgwire or a synchronous rewrite of rust-postgres? Why? Thank you for any advice! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I would be open to accept a PR that adds listen/notify support to diesel itself, as long as the API is reasonable and as long as the PR contains documentation and some tests. We do not have any ready design for this, so figuring out the right API would be the first step.
I'm not interested in doing that as it would make it harder to work on diesel internals. |
Beta Was this translation helpful? Give feedback.
-
I've prepared a PR: #4420 |
Beta Was this translation helpful? Give feedback.
I would be open to accept a PR that adds listen/notify support to diesel itself, as long as the API is reasonable and as long as the PR contains documentation and some tests. We do not have any ready design for this, so figuring out the right API would be the first step.
I'm not interested in doing that as it would make it harder to work on diesel internals.