python - Are grequests responses in the same order as the requests? -


i using grequests asynchronously download data website using same url different parameters.

for example,

unsent_requests = [] param in params: # assume params list containing different parameters or query strings     unsent_requests.append(grequests.get(url = url, params = param))  responses = grequests.map(unsent) 

how can possibly know response responses belongs request unsent_requests? or responses in same order unsent requests?

ps: response.url not give clue because different url returns.

responses in same order requests, shown in usage example:

>>> reqs = [ ...    grequests.get('http://httpbin.org/delay/1', timeout=0.001), ...    grequests.get('http://fakedomain/'), ...    grequests.get('http://httpbin.org/status/500')] >>> grequests.map(reqs, exception_handler=exception_handler) request failed request failed [none, none, <response [500]>] 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -