Score:1

Use async with drupal_http_request()

in flag

I need to make an asynchronous call with drupal_http_request(). Is it possible?

Score:0
bd flag

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().

berliner avatar
bd flag
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](https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_http_request/7.x), 2. Search for "blocking" on that page ;)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.