MCPcopy
hub / github.com/PokemonGoF/PokemonGo-Bot / SocketIoRunner

Class SocketIoRunner

pokemongo_bot/socketio_server/runner.py:13–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12
13class SocketIoRunner(object):
14 def __init__(self, url):
15 self.host, port_str = url.split(':')
16 self.port = int(port_str)
17 self.server = None
18
19 # create the thread object
20 self.thread = threading.Thread(target=self._start_listening_blocking)
21
22 # wrap Flask application with socketio's middleware
23 self.app = socketio.Middleware(sio, app)
24
25 def start_listening_async(self):
26 wsgi.is_accepting = True
27 self.thread.start()
28
29 def stop_listening(self):
30 wsgi.is_accepting = False
31
32 def _start_listening_blocking(self):
33 # deploy as an eventlet WSGI server
34 listener = eventlet.listen((self.host, self.port))
35 self.server = wsgi.server(listener, self.app, log_output=False, debug=False)

Callers 2

ws_server.pyFile · 0.90
_setup_event_systemMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected