This is for the page_put_queue [1] which holds the pages which are saved asynchronously. To use it take asynchronous=True parameter for Page.save() [2] or BaseBot.userPut() [3] method. The later sets it if the parameter is not given but always parameter is set to True. There are other methods which are using asynchronous parameter. [4] See [5] for the implementation.
Best xqt
Am 28.03.2023 um 00:32 schrieb Roy Smith <r...@panix.com>:
Thanks for the replies. I've got something basically working with concurrent.futures, so I guess I'll go with that.
I see there's a max_queue_size setting available in user_config.py. I assume that is related to one or another of these examples?
Pywikibot uses request for io methods. I had have a look at several similar libraries with asyncio support but none of them were long term supported.
It is a good advice to ensure that pages are preloaded. Anyway Pywikibot does not use asyncio (yet) but it used Threads to save pages asynchronously. The common BaseBot.treat() or BaseBot.treat_page() cannot be used asynchronously because it is not Thread safe.
You can find concurrent programming examples within the framework. weblinkchecker for example uses Threads to retrieve web pages in parallel. archivebot is able to process all pages from a generator in parallel using concurrent futures. Other examples with concurrent futures can be found in login script, preload_sites, fixing_redirects and watchlist script.
I hope that helps a bit Best
_______________________________________________ pywikibot mailing list -- pywikibot@lists.wikimedia.orgPublic archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/F4OKUOJLTXEQ23TAK557U45IUMTTF3A3/To unsubscribe send an email to pywikibot-le...@lists.wikimedia.org
_______________________________________________pywikibot mailing list -- pywikibot@lists.wikimedia.orgPublic archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/U46M47IROTE2DDUX2FWHB3JOW4IQWZTA/To unsubscribe send an email to pywikibot-le...@lists.wikimedia.org
|
_______________________________________________
pywikibot mailing list -- pywikibot@lists.wikimedia.org
Public archives at
https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/3WUE6BVLR6IJMHCYQJCOON6G5YTKHH4O/
To unsubscribe send an email to pywikibot-le...@lists.wikimedia.org