English (United Kingdom)
Knowledge Base  >  Vik Appointments  >  Hooks  >  Web Hooks  >  Close HTTP Connection

apply_filters( 'vikappointments_before_close_http_connection', bool $status )

Fires before closing the HTTP connection.


Description

The web hooks are always queued and deployed after presenting the HTML document. In order to avoid waiting for the completion of the requests, the system terminates the page loading by using the native fastcgi_finish_request() PHP function, when available.

It is possible to use this hook to safely prevent the closure of the HTTP connection at runtime. This way we can prevent any errors that might occur with certain server configurations.

NOTE: this filter doesn't trigger in case the fastcgi_finish_request() function is not available.


Parameters

$status

(bool)  False to prevent the HTTP connection.


Example

/**
 * Trigger hook to safely prevent the closure of the HTTP connection at runtime.
 * This way we can prevent any errors that might occur with certain server
 * configurations.
 *
 * @param  boolean  $status  False to avoid closing the connection. 
 */
add_filter('vikappointments_before_close_http_connection', function($status)
{
    // do not close the connection
    return false;   
});

Changelog

Version Description
1.2 Introduced.
Last Update: 2021-10-08
Helpful?

This website uses cookies

This website uses cookies and similar technologies. Some of these technologies are necessary for the proper functioning of the website (Essential). Other technologies are used to evaluate user behavior (Analysis), to integrate external media or for advertising purposes. If you agree, these technologies are activated. For details, please refer to the privacy policy. From this same page you can also update/revoke your consent. If you do not give your consent, only cookies with essential functions will be activated.

We use technologies from the USA on our website. If you give your consent, you therefore consent at the same time to your data being transferred to the USA. We would like to point out that the USA does not have a level of data protection comparable to that of the EU and that any US company can be obliged by state authorities to hand over your data without you having any effective legal protection against this.