-
Notifications
You must be signed in to change notification settings - Fork 17
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 version of this library ? #9
Comments
I haven't written any async code yet, but I will give it a try soon. |
Ok ! If you nedd any help I can help you. |
@Nereg what is it that you're trying to do with this that isn't working due to Async? We use this on our Discord bot just fine as is
|
That's just marking a function as async without it actually being async. It still blocks waiting for a server response. |
It stoped my bot for a while. I am using discord.py and may be it is their problem or it is my code. But I think I will rewrite this library. |
I'll give it a try as well as soon as I have time. Let's leave this open, because this is still a feature we want to have. |
Im having the same issue right now, trying to make a bot with the library, but it just blocks the code, when the server responds it just does nothing and blocks the task, is there a way you could add a timeout parameter or something? |
Just a quick update: I am still working on this, it's just taking me way more time than expected figuring out how to properly do async UDP. But reading docs is my top priority right now and I'm committed to delivering an async implementation soon. |
I appreciate it |
Development branch: https://github.com/Yepoleb/python-a2s/tree/async |
Feature PR, please leave feedback if you can: #10 |
In fact I found code that asyncs some method. Here it is : async def async_a2s_info(addr):
loop = asyncio.get_event_loop()
return await loop.run_in_executor(None, a2s.info, addr) Found here |
Great idea to use the threading integration in asyncio to do this. The new implementation uses coroutines instead of threads though, so it scales much better, because it doesn't flood the OS with threads when mass querying. |
Running in executor and using wait for is the perfect solution, tho it’s not really async |
Yeah if I will rewrite my code I will be better using not fast solution to async. And thanks you for all your support ! |
Branch is now merged. |
Hi ! I am building bot for discord using async library so I wonderd if you can create or show me async analog of this library! Also if you nedd help to re-write some code I will help !
The text was updated successfully, but these errors were encountered: