Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation about the livecycle of a request #876

Open
hirasso opened this issue Jun 19, 2024 · 0 comments
Open

Add documentation about the livecycle of a request #876

hirasso opened this issue Jun 19, 2024 · 0 comments

Comments

@hirasso
Copy link

hirasso commented Jun 19, 2024

Hello there 👋👋

I have chosen this issue template since I don't know where else to post my question:

My Question

Are Requests being finished, even if the user that invoked the current script closes their browser?

Additional context

I ended up in this Repo since I source-dived wp-cron to find out how it worked. Turns out it sends a HTTP request from cron.php to wp-cron.php to invoke scheduled jobs:

$result = wp_remote_post( $cron_request['url'], $cron_request['args'] );

That call leads through a few other files to this request call in class-wp-http.php:

$requests_response = WpOrg\Requests\Requests::request( $url, $headers, $data, $type, $options );

Now I couldn't find any resources on the web about the question if this HTTP POST call will be finished, even if the current visitor closes their connection (e.g. browser tab) – or if it will be cancelled with the user session. That would be valuable information for scenarios where there would be long running processes that should be invoked by a cron job.

Source-diving the Requests library also is a bit over my head 😅 I'd be very grateful for any definite answer! It would be amazing to be pointed towards the relevant code, if it turns out that these requests will be finished, not matter what...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant