CXuesong / WikiClientLibrary

/*🌻*/ Wiki Client Library is an asynchronous MediaWiki API client library targeting modern .NET platforms
https://github.com/CXuesong/WikiClientLibrary/wiki
Apache License 2.0
80 stars 16 forks source link

RecentChangesGenerator#EnumRecentChanges and RecentChangesGenerator#EnumRecentChangesAsync don't finish #19

Closed Kroppeb closed 7 years ago

Kroppeb commented 7 years ago

My code freezes at this location in my code. I have no idea why and i have no idea where to post this. The api endpoint: "http://gamemode4.wikia.com/api.php"

The first breakpoint gets triggered. The second one wont image

CXuesong commented 7 years ago

Now that we do not have any forum; open an issue here is okay.

Actually, if you do not limit the maximum count of the results, this generator will enumerate through all the Recent Changes entries from now to the beginning of the site. Do you mean

rcg.EnumRecentChanges().Take(count).ToList();

PagingSize affects the count of results fetched per API request. (max. 50 for human and 500 for bots) For example, you may set PagingSize to 10, so each time WCL making MediaWiki API request, it asks for 10 results. However, you still can ask for 30 results from EnumRecentChanges (e.g. rcg.EnumRecentChanges().Take(30).ToList(), but this time WCL will make 3 requests to fetch 30 results.)

On the other hand, if you set PagingSize to 50, while only ask for top 10 results (e.g. rcg.EnumRecentChanges().Take(10).ToList()), the rest of the results received will be just wasted. So you need to choose wisely ;-)