Commit 0bd5df9
committed
Add low-level access to fb_shutdown_callback API functions
libfbclient handle signals on its own, so driver will get shutdown error on SIGTERM/SIGINT/SIGBREAK and there is no other possibilities to prevent it and softly stop process except handling shutdown manually:
Example of fb_shutdown_callback usage:
@FB_SHUTDOWN_CALLBACK
def driver_shutdown_callback(reason, mask, arg):
return 1 if reason == fb_shutrsn_signal else 0
def api_loaded_hook(api):
status = ISC_STATUS_ARRAY(20)
api.fb_shutdown_callback(status, driver_shutdown_callback, fb_shut_confirmation, None)
if db_api_error(status):
raise exception_from_status(InternalError, status, "Error while adding shutdown callback")
add_hook(APIHook.LOADED, FirebirdAPI, api_loaded_hook)1 parent ee0c566 commit 0bd5df9
1 file changed
+24
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
126 | 142 | | |
127 | 143 | | |
128 | 144 | | |
| |||
238 | 254 | | |
239 | 255 | | |
240 | 256 | | |
| 257 | + | |
241 | 258 | | |
242 | 259 | | |
243 | 260 | | |
| |||
1951 | 1968 | | |
1952 | 1969 | | |
1953 | 1970 | | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
1954 | 1978 | | |
1955 | 1979 | | |
1956 | 1980 | | |
| |||
0 commit comments