[CogManager, Utils] Handle missing cogs correctly, add some helpful algorithms (#1989)

* Handle missing cogs correctly, add some helpful algorithms

For cog loading, only show "cog not found" if the module in question was the one
that failed to import. ImportErrors within cogs will show an error as they should.

- deduplicator, benchmarked to be the fastest
- bounded gather and bounded async as_completed
- tests for all additions

* Requested changes + wrap as_completed instead

So I went source diving and realized as_completed works the way I want it to,
and I don't need to reinvent the wheel for cancelling tasks that remain
if the generator is `break`ed out of. So there's that.
This commit is contained in:
Caleb Johnson
2018-08-20 20:26:04 -05:00
committed by Toby Harradine
parent b550f38eed
commit 1329fa1b09
5 changed files with 322 additions and 49 deletions

View File

@@ -4,6 +4,12 @@
Utility Functions
=================
General Utility
===============
.. automodule:: redbot.core.utils
:members: deduplicate_iterables, bounded_gather, bounded_gather_iter
Chat Formatting
===============