I need to make an asynchronous call with drupal_http_request()
. Is it possible?
1 Answer
With drupal_http_request this is not possible. But you can have a look at the module HTTP Parallel Request & Threading Library which allows you to do non-blocking requests.
From the module page:
Using stream_select() it will send http requests out in parallel. These requests can be made in a blocking or non-blocking way. Blocking will wait for the http response; Non-Blocking will close the connection not waiting for the response back. The API for httprl is similar to the Drupal 7 version of drupal_http_request().
-
I happen to know the module as I have used it in the past. But apart from that, the way of finding it would literally be: 1. Got to the API doc for drupal_http_request, 2. Search for "blocking" on that page ;)– berlinerCommented Nov 7, 2021 at 21:57