Best option for low level Postgres connection without tokio or async #4418
Unanswered
thkoch2001
asked this question in
Q&A
Replies: 1 comment
-
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.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.
b) Use rust-postgres crate and ignore that it sucks in tokio.
c) Write my own postgres client lib using available building blocks from rust-postgres and/or pgwire
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.
All reactions