Outside of the first two lines that are authentication-related, there was two round-trips to access the content of a single page on AppNexus side.
Therefore, in cases where AppNexus API doesn't handle pagination/filtering properly (ChangeLog and ChangeLogDetails services, for example) and sends the whole batch-sized page all the time, getting a single page costs us the same as getting two.
Considering the following code snippet:
The execution will log the following:
Outside of the first two lines that are authentication-related, there was two round-trips to access the content of a single page on AppNexus side.
Therefore, in cases where AppNexus API doesn't handle pagination/filtering properly (ChangeLog and ChangeLogDetails services, for example) and sends the whole batch-sized page all the time, getting a single page costs us the same as getting two.
The call to
cursor.count()
incursor.iter_pages()
is to blame for the additional round-trip: https://github.com/numberly/appnexus-client/blob/64013debe23c03a19c186ac46683a753c49e8483/appnexus/cursor.py#L89-L95