petewarden/ParallelCurl — pull request #21 by galymzhan (2014-11-26 11:44:15+00:00)
Title: clear outstanding request before invoking callback

When you put new requests into queue by calling "startRequest" **inside** a callback, the outstanding request never gets a chance to be cleaned up from queue and the program gets stuck. Demonstrated by this simple script:

```php
startRequest('example.com', $callback, ['i' => $i + 1]);
};

$pc->startRequest('example.com', $callback, ['i' => 1]);
$pc->finishAllRequests();
```

The proposed change fixes it by first removing outstanding request from the queue and then invoking the callback.