title: How to get Request object in Guzzle?
body: <p>I need to check a lot of items from my db with Guzzle. For example, amount of items is 2000-5000. It is too many to load it all in a single array, so I want to break it in chunks: SELECT * FROM items LIMIT 100. When last item is sent to Guzzle then next 100 items are requested. In 'fulfilled' handler I should know which item got the response. I see that we have $index here, which points to the number of current item. But I don't have an access to scope where $items variable is visible. Anyway, if I even get access it via use($items) then in second pass of the loop I get wrong index, because indexes in $items array will start from 0, while $index will be >100. So, this method will not work. </p>
  
  <pre><code>    $client = new Client();
      $iterator = function() {
           while($items = getSomeItemsFromDb(100)) {
                foreach($items as $item) {
                     echo "Start item #{$item['id']}";
                     yield new Request('GET', $item['url']);
                }
           }
      };
  
      $pool = new Pool($client, $iterator(), [
          'concurrency' =&gt; 20,
          'fulfilled' =&gt; function (ResponseInterface $response, $index) {
              // how to get $item['id'] here?
          },
          'rejected' =&gt; function (RequestException $reason, $index) {
              call_user_func($this-&gt;error_handler, $reason, $index);
          }
      ]);
  
      $promise = $pool-&gt;promise();
      $promise-&gt;wait();
  </code></pre>
  
  <p>I think if I could do something like </p>
  
  <pre><code>$request = new Request('GET', $item['url']);
  $request-&gt;item = $item;
  </code></pre>
  
  <p>and then in 'fulfilled' handler just to get $request from $response - that would be ideal. But as I can see, there is no way to do something like $response->getRequest(). 
  Any suggestions about how to solve this?</p>