mdref.json config
[mdref/mdref-http] / http / Client / enqueue.md
index 24ba8fa949158a9b792e2c63b2e224109c89d942..25889a7c9b0062eac1a4624e3683d50a9e7f12ba 100644 (file)
@@ -3,13 +3,22 @@
 Add another http\Client\Request to the request queue.
 If the optional callback $cb returns true, the request will be automatically dequeued.
 
+> ***Note:***  
+> The http\Client\Response object resulting from the request is always stored 
+> internally to be retrieved at a later time, __even__ when $cb is used.
+> 
+> If you are about to send a lot of requests and do __not__ need the response
+> after executing the callback, you can use http\Client::getResponse() within
+> the callback to keep the memory usage level as low as possible.
+
 See http\Client::dequeue() and http\Client::send().
 
+
 ## Params:
 
 * http\Client\Request $request  
   The request to enqueue.
-* Optional callable $cb  
+* Optional callable $cb as function(\http\Response $response) : ?bool  
   A callback to automatically call when the request has finished.
 
 ## Returns:
@@ -18,7 +27,9 @@ See http\Client::dequeue() and http\Client::send().
 
 ## Throws:
 
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\BadMethodCallException
+* http\Exception\RuntimeException
 
 ## Example: