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

connector.stop() issue #18

Open
KillerBOSS2019 opened this issue Aug 20, 2021 · 3 comments · May be fixed by #34
Open

connector.stop() issue #18

KillerBOSS2019 opened this issue Aug 20, 2021 · 3 comments · May be fixed by #34

Comments

@KillerBOSS2019
Copy link

connector.stop() does not work, well it works with that pull requests but not when the League client isnt open

@sousa-andre
Copy link
Owner

You're right. I'll take a look into that as soon as possible.

@Avnsx
Copy link

Avnsx commented Jul 5, 2022

You're right. I'll take a look into that as soon as possible.

Pretty sure the issue is because we are trying to listen to websockets, while the league client which hosts the LCU API endpoints is closed. So it gets stuck there, because run_ws ends up being an infinite loop

await self.run_ws()

Avnsx added a commit to Avnsx/lcu-driver that referenced this issue Jul 16, 2023
+ fixes (sousa-andre#18)
+ Each WebSocket registered by the user is now stored in a list called self.connections. This allows us to iterate over each stored connection object later when the connector.stop() method is called. By unregistering each connection, the method can successfully close the connections as intended. This prevents the occurrence of an infinite loop, which could happen if the @connector.ws.register() decorator was used to register a connection before
@Avnsx Avnsx linked a pull request Jul 16, 2023 that will close this issue
@sousa-andre
Copy link
Owner

You're right. I'll take a look into that as soon as possible.

Pretty sure the issue is because we are trying to listen to websockets, while the league client which hosts the LCU API endpoints is closed. So it gets stuck there, because run_ws ends up being an infinite loop

await self.run_ws()

This problem only happens when the client is not yet opened. I expect to solve this issue in the next release by creating a new method that should be ran in a different thread in order to stop the library when it's looking for new clients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants