From 15138e98542dc5283cfeb13f07d55466a0473a13 Mon Sep 17 00:00:00 2001 From: Kodie Goodwin Date: Fri, 8 Dec 2017 15:06:17 -0800 Subject: [PATCH] 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 --- disco/client.py | 4 ++-- disco/util/websocket.py | 2 +- disco/voice/client.py | 4 ++-- disco/voice/player.py | 2 +- requirements.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/disco/client.py b/disco/client.py index 3374282..14ff5ea 100644 --- a/disco/client.py +++ b/disco/client.py @@ -88,8 +88,8 @@ class Client(LoggingClass): super(Client, self).__init__() self.config = config - self.events = Emitter(spawn_each=True) - self.packets = Emitter(spawn_each=True) + self.events = Emitter() + self.packets = Emitter() self.api = APIClient(self.config.token, self) self.gw = GatewayClient(self, self.config.max_reconnects, self.config.encoder) diff --git a/disco/util/websocket.py b/disco/util/websocket.py index bd684e2..5297bda 100644 --- a/disco/util/websocket.py +++ b/disco/util/websocket.py @@ -20,7 +20,7 @@ class Websocket(LoggingClass, websocket.WebSocketApp): LoggingClass.__init__(self) websocket.WebSocketApp.__init__(self, *args, **kwargs) - self.emitter = Emitter(spawn_each=True) + self.emitter = Emitter() # Hack to get events to emit for var in six.iterkeys(self.__dict__): diff --git a/disco/voice/client.py b/disco/voice/client.py index cbb75c6..ba379f9 100644 --- a/disco/voice/client.py +++ b/disco/voice/client.py @@ -129,13 +129,13 @@ class VoiceClient(LoggingClass): self.encoder = encoder or JSONEncoder # 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.SESSION_DESCRIPTION, self.on_voice_sdp) # State + state change emitter self.state = VoiceState.DISCONNECTED - self.state_emitter = Emitter(spawn_each=True) + self.state_emitter = Emitter() # Connection metadata self.token = None diff --git a/disco/voice/player.py b/disco/voice/player.py index a38dff9..12b4a72 100644 --- a/disco/voice/player.py +++ b/disco/voice/player.py @@ -44,7 +44,7 @@ class Player(object): self.complete = gevent.event.Event() # Event emitter for metadata - self.events = Emitter(spawn_each=True) + self.events = Emitter() def disconnect(self): self.client.disconnect() diff --git a/requirements.txt b/requirements.txt index c6d70fa..ce93f35 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ gevent==1.2.2 -holster==1.1.0 +holster==2.0.0 requests==2.18.4 six==1.11.0 websocket-client==0.44.0