Skip to content
This repository has been archived by the owner. It is now read-only.

Bot/Client does not run inside a given asyncio loop #420

Closed
Budovi opened this issue Dec 20, 2016 · 1 comment
Closed

Bot/Client does not run inside a given asyncio loop #420

Budovi opened this issue Dec 20, 2016 · 1 comment
Labels

Comments

@Budovi
Copy link

@Budovi Budovi commented Dec 20, 2016

When creating a discord.Client or discord.ext.commands.Bot, you have an option to pass an event loop for the Client to use.

loop (Optional[event loop].) – The event loop to use for asynchronous operations. Defaults to None, in which case the default event loop is used via asyncio.get_event_loop().

A lot of calls in the library do not respect this choice, and a default event loop is used instead. You can find a lot of examples just by searching for asyncio.sleep( in the library code, where the loop needs to be passed as an argument.

This option does not make sense if broken, and thus

  • it should be either removed, or
  • it should be fixed so that the library only uses the loop provided, or
  • it should be clarified what operations is the given loop used for.
@Rapptz Rapptz added the bug label Dec 21, 2016
@Rapptz
Copy link
Owner

@Rapptz Rapptz commented Dec 21, 2016

Where "a lot" was 5 7. Good catch nonetheless.

For the next bug report I recommend not using hyperboles.

Loading

@Rapptz Rapptz closed this Dec 21, 2016
Rapptz added a commit that referenced this issue Dec 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants