Closed LadaBr closed 7 years ago
I already solved it, Now I'm trying to find out whats wrong with something else.
I want to use this package together with django and uwsgi but when i try to load web page when steam client is running I always get this error:
Traceback (most recent call last): File "/usr/local/lib/python3.5/socketserver.py", line 625, in process_request_thread self.finish_request(request, client_address) File "/usr/local/lib/python3.5/socketserver.py", line 354, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/local/lib/python3.5/socketserver.py", line 681, in init self.handle() File "/var/www/dotaleague.cz/env/lib/python3.5/site-packages/django/core/servers/basehttp.py", line 159, in handle self.raw_requestline = self.rfile.readline(65537) File "/usr/local/lib/python3.5/socket.py", line 575, in readinto return self._sock.recv_into(b) File "/var/www/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_socket3.py", line 385, in recv_into self._wait(self._read_event) File "/var/www/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_socket3.py", line 157, in _wait self.hub.wait(watcher) File "/var/www/dotaleague.cz/env/lib/python3.5/site-packages/gevent/hub.py", line 651, in wait result = waiter.get() File "/var/www/dotaleague.cz/env/lib/python3.5/site-packages/gevent/hub.py", line 899, in get return self.hub.switch() File "/var/www/dotaleague.cz/env/lib/python3.5/site-packages/gevent/hub.py", line 630, in switch return RawGreenlet.switch(self) gevent.hub.LoopExit: ('This operation would block forever', <Hub at 0x7f433c1945a0 epoll pending=0 ref=0 fileno=16>)
You should spend some time reading how gevent
package works. It can probably work with django, but there is some special magic you need to do. Using time.sleep
will block your code, unless it's been monkey patched.
Sorry for another question but I really love your py package. I added chat functionality and it works great but I would like to do something like timed event that would repeat every X seconds. I want bot to create lobby for 5 minutes and tell how much time is remaining until lobby is abandoned or all players wont connect.
Example:
But when I use this code it always wait until entire loop is finished. Thanks for help.