FirebirdSQL / fdb

Firebird Driver for Python
https://www.firebirdsql.org/en/devel-python-driver/
Other
60 stars 26 forks source link

Add fb_shutdown_callback and fb_shutdown to internal API #17

Closed artyom-smirnov closed 1 year ago

artyom-smirnov commented 3 years ago

To allow control shutdown process of driver. For example:

from fdb.ibase import FB_SHUTDOWN_CALLBACK, fb_shut_confirmation, fb_shutrsn_signal, fb_shutrsn_app_stopped

@FB_SHUTDOWN_CALLBACK def shutdown_callback(reason, mask, arg): if reason == fb_shutrsn_signal: return 1 return 0

status = fdb.ISC_STATUS(0) fdb.fbcore.api.fb_shutdown_callback(status, shutdown_callback, fb_shut_confirmation, None)

...

fdb.fbcore.api.fb_shutdown(0, fb_shutrsn_app_stopped)