Browse Source

Remove spawn_each args during Emitter init (#62)

* Remove spawn_each args during Emitter init

* Pin holster to master in requirements.txt

* Bump holster to 2.0.0
pull/70/head
Kodie Goodwin 7 years ago
committed by Andrei Zbikowski
parent
commit
15138e9854
  1. 4
      disco/client.py
  2. 2
      disco/util/websocket.py
  3. 4
      disco/voice/client.py
  4. 2
      disco/voice/player.py
  5. 2
      requirements.txt

4
disco/client.py

@ -88,8 +88,8 @@ class Client(LoggingClass):
super(Client, self).__init__() super(Client, self).__init__()
self.config = config self.config = config
self.events = Emitter(spawn_each=True) self.events = Emitter()
self.packets = Emitter(spawn_each=True) self.packets = Emitter()
self.api = APIClient(self.config.token, self) self.api = APIClient(self.config.token, self)
self.gw = GatewayClient(self, self.config.max_reconnects, self.config.encoder) self.gw = GatewayClient(self, self.config.max_reconnects, self.config.encoder)

2
disco/util/websocket.py

@ -20,7 +20,7 @@ class Websocket(LoggingClass, websocket.WebSocketApp):
LoggingClass.__init__(self) LoggingClass.__init__(self)
websocket.WebSocketApp.__init__(self, *args, **kwargs) websocket.WebSocketApp.__init__(self, *args, **kwargs)
self.emitter = Emitter(spawn_each=True) self.emitter = Emitter()
# Hack to get events to emit # Hack to get events to emit
for var in six.iterkeys(self.__dict__): for var in six.iterkeys(self.__dict__):

4
disco/voice/client.py

@ -129,13 +129,13 @@ class VoiceClient(LoggingClass):
self.encoder = encoder or JSONEncoder self.encoder = encoder or JSONEncoder
# Bind to some WS packets # Bind to some WS packets
self.packets = Emitter(spawn_each=True) self.packets = Emitter()
self.packets.on(VoiceOPCode.READY, self.on_voice_ready) self.packets.on(VoiceOPCode.READY, self.on_voice_ready)
self.packets.on(VoiceOPCode.SESSION_DESCRIPTION, self.on_voice_sdp) self.packets.on(VoiceOPCode.SESSION_DESCRIPTION, self.on_voice_sdp)
# State + state change emitter # State + state change emitter
self.state = VoiceState.DISCONNECTED self.state = VoiceState.DISCONNECTED
self.state_emitter = Emitter(spawn_each=True) self.state_emitter = Emitter()
# Connection metadata # Connection metadata
self.token = None self.token = None

2
disco/voice/player.py

@ -44,7 +44,7 @@ class Player(object):
self.complete = gevent.event.Event() self.complete = gevent.event.Event()
# Event emitter for metadata # Event emitter for metadata
self.events = Emitter(spawn_each=True) self.events = Emitter()
def disconnect(self): def disconnect(self):
self.client.disconnect() self.client.disconnect()

2
requirements.txt

@ -1,5 +1,5 @@
gevent==1.2.2 gevent==1.2.2
holster==1.1.0 holster==2.0.0
requests==2.18.4 requests==2.18.4
six==1.11.0 six==1.11.0
websocket-client==0.44.0 websocket-client==0.44.0

Loading…
Cancel
Save