Subject Re: [firebird-python] Timeout for connection
Author Pavel Cisar
Hi,

Dne 20.12.2017 v 11:41 Zbigniew Szmigiero zszmigiero@...
[firebird-python] napsal(a):
>
> The current Connection string does not provide any parameter to define timeout.
> It is crucial to have possibility set up it when incorrect connection parameters are provided
> In most PyDB compliant drivers there is connection_timeout parameter to support user based timeout for connection timeout..
>
> Do you plan implement this functionality or can be it achieved using different method?

I suppose you are asking for timeout to successfully establish the
connection? Well, I see only one situation when this could be useful -
when network layer will "sleep" in attempt to establish the connection
between client and server host. While it may happen, I don't think it's
common enough to justify the work to support it directly in FDB.

However, you should be able to achieve what you want easily with timeout
decorator or context manager around fdb.connect() call. I didn't tested
it, but it seems that 'stopit' module should work for that. See
https://pypi.python.org/pypi/stopit

best regards
Pavel Cisar
IBPhoenix