Replies: 1 comment 2 replies
-
It makes sense, I like it. I wonder if it should be a "pool class" or a "pool factory" (those are conceptually the same thing: a callable that returns a pool instance), but it could well be any other callable and not a class) Would you like to contribute this ? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
PsycopgConnector
currently usespsycopg_pool.AsyncConnectionPool
by default. It's possible to passpool
argument toApp.open_async
which overrides this, but it's not as easy to pass it to procrastinateworker
/defer
CLI commands. I ended up with overridingopen_async
method ofPsycopgConnector
like this:This works, but it doesn't feel very clean. I'd rather have
connection_pool_cls
kwarg onPsycopgConnector
where I could passAsyncNullConnectionPool
(or any other class inheriting fromAsyncConnectionPool
). If specified, this class would be used instead ofAsyncConnectionPool
inPsycopgConnector._create_pool
. It would be used like this:What do you think?
Beta Was this translation helpful? Give feedback.
All reactions