(self)
return message
Returns messages that were stored into the
        `messages` queue and returns `None` when the
        websocket is terminated or closed.
Returns messages that were stored into the
        `messages` queue and returns `None` when the
        websocket is terminated or closed.
Returns messages that were stored into the messages queue and returns None when the websocket is terminated or closed .
def receive(self):
        """
        Returns messages that were stored into the
        `messages` queue and returns `None` when the
        websocket is terminated or closed.
        """
        # If the websocket was terminated and there are no messages
        # left in the queue, return None immediately otherwise the client
        # will block forever
        if self.terminated and self.messages.empty():
            return None
        message = self.messages.get()
        if message is StopIteration:
            return None
        return message
def receive ( self ) : # If the websocket was terminated and there are no messages # left in the queue, return None immediately otherwise the client # will block forever if self . terminated and self . messages . empty ( ) : return None message = self . messages . get ( ) if message is StopIteration : return None return message