Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async Websockets #6

Closed
TheUntraceable opened this issue Jan 26, 2022 · 11 comments
Closed

Async Websockets #6

TheUntraceable opened this issue Jan 26, 2022 · 11 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@TheUntraceable
Copy link
Member

We should switch to Asynchronous Websockets with AIOHTTP, but the thing is I don't get how we'll use client.login, maybe that'll run the async version? I'm still baffled on how to do this one.

@TheUntraceable
Copy link
Member Author

Working on this by the way :D

@TheUntraceable
Copy link
Member Author

I can't make the login function which is meant to synchronous, whilst everything else being asynchronous.

@TheUntraceable
Copy link
Member Author

I accidently closed this issue.

@TheUntraceable TheUntraceable added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed labels Feb 5, 2022
@Jerry-py
Copy link
Contributor

Jerry-py commented Feb 6, 2022

Maybe use asyncio.run(coro)

Maybe or use some other module like syncer

@Jerry-py
Copy link
Contributor

Jerry-py commented Feb 6, 2022

asyncio.get_event_loop().run_until_complete can be another option?

I say this is probably the best option out of my responses

@TheUntraceable
Copy link
Member Author

asyncio.get_event_loop().run_until_complete can be another option?

I say this is probably the best option out of my responses

I'll try it, I forget I could use that and I was creating an entirely new loop just to utilise the Loop.run_forever

@Jerry-py
Copy link
Contributor

Jerry-py commented Feb 6, 2022

https://github.com/Pycord-Development/pycord/blob/master/discord/client.py#L613-L671

Run is sync and in you can have a async function in sync function

@Jerry-py
Copy link
Contributor

Jerry-py commented Feb 7, 2022

Probably fixed in #29

@Jerrydotpy
Copy link
Contributor

Are we done yet?

@TheUntraceable
Copy link
Member Author

Nope. Pretty close though.

@TheUntraceable
Copy link
Member Author

Fixed in the latest commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants