Comments (16)
Branch is now merged.
from python-a2s.
Development branch: https://github.com/Yepoleb/python-a2s/tree/async
from python-a2s.
I haven't written any async code yet, but I will give it a try soon.
from python-a2s.
Ok ! If you nedd any help I can help you.
from python-a2s.
@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
server_info = ''
server_players = ''
async def server():
global server_info
global server_players
try:
server_info = a2s.info(server_address, 1.0)
server_players = a2s.players(server_address)
return True
except:
return False
from python-a2s.
That's just marking a function as async without it actually being async. It still blocks waiting for a server response.
from python-a2s.
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.
from python-a2s.
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.
from python-a2s.
That's just marking a function as async without it actually being async. It still blocks waiting for a server response.
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?
from python-a2s.
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.
from python-a2s.
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
from python-a2s.
Feature PR, please leave feedback if you can: #10
from python-a2s.
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
from python-a2s.
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.
from python-a2s.
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
from python-a2s.
Yeah if I will rewrite my code I will be better using not fast solution to async. And thanks you for all your support !
from python-a2s.
Related Issues (20)
- Example server is down :frowning: HOT 2
- Settings being returned are encrypted HOT 9
- a2s.players name doesn't work for "7 Days to Die" HOT 4
- Is it possible to query every server ? HOT 1
- Question HOT 3
- How do i get an output?
- A2S_RULES not decoding correctly ? HOT 13
- [Question] Multiple Query HOT 1
- Is it possible to to see if player is on CT or T Side? HOT 1
- Rust server returning random player names instead of actual player names when using a2s.players HOT 3
- S2C_CHALLENGE support? HOT 3
- implementing player steamid's if connected using steam HOT 1
- Strange a2s.exceptions.BufferExhaustedError HOT 3
- Proposal: add A2S_PING for query server HOT 1
- Rust server names HOT 2
- query is inaccurate HOT 1
- suggestion HOT 1
- Class attribute docstrings show wrong values. HOT 3
- player_count HOT 2
- Request: Get MvM Mission and wave progress HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-a2s.