Re: Designing a better connection pool for psycopg3

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Re: Designing a better connection pool for psycopg3
Дата
Msg-id YAWZAK9keRiSHaRs@hermes.hilbert.loc
обсуждение исходный текст
Ответ на Re: Designing a better connection pool for psycopg3  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Ответы Re: Designing a better connection pool for psycopg3  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Список psycopg
Am Mon, Jan 18, 2021 at 02:50:34PM +0100 schrieb Daniele Varrazzo:

> > I would strongly advise against making sys.exit() the default
> > for pool.terminate() unless I misunderstand something.
>
> How would you terminate the program if a maintenance thread, not the
> main one, thinks that the program is not in working state?

To me it is not the business of a library to terminate its
user (eg an application) upon resource starvation. After all,
the app may be perfectly fine with not being able to talk to
the database. Only it knows what to do under such
circumstances.

If one wants to support such machinery, I would suggest a
callback into the application, set up by the application
code.

Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B



В списке psycopg по дате отправления:

Предыдущее
От: Karsten Hilbert
Дата:
Сообщение: Re: Designing a better connection pool for psycopg3
Следующее
От: Daniele Varrazzo
Дата:
Сообщение: Re: Designing a better connection pool for psycopg3