(self, timeout=None)
return self._event_queue.pop(0) if self._event_queue else None
Blocks until an event is received or the *timeout* exceeds. The next
        received event is returned.

        A simple event loop looks like this:

        .. code-block:: python3

            ts3conn.servernotifyregister(event="server")
            while True:
                ts3conn.send_keepalive()
                try:
                    event = ts3conn.wait_for_event(timeout=60)
                except TS3TimeoutError:
                    pass
                else:
                    # Handle the received event here ...

        :arg timeout:
            The maximum number of seconds waited for the next event.
        :type timeout:
            None or float

        :rtype: TS3Event
        :returns:
            The next received ts3 event.

        :raises TS3TimeoutError:
        :raises TS3RecvError:
Blocks until an event is received or the *timeout* exceeds. The next
        received event is returned.
Blocks until an event is received or the * timeout * exceeds . The next received event is returned .
def wait_for_event(self, timeout=None):
        """
        Blocks until an event is received or the *timeout* exceeds. The next
        received event is returned.

        A simple event loop looks like this:

        .. code-block:: python3

            ts3conn.servernotifyregister(event="server")
            while True:
                ts3conn.send_keepalive()
                try:
                    event = ts3conn.wait_for_event(timeout=60)
                except TS3TimeoutError:
                    pass
                else:
                    # Handle the received event here ...

        :arg timeout:
            The maximum number of seconds waited for the next event.
        :type timeout:
            None or float

        :rtype: TS3Event
        :returns:
            The next received ts3 event.

        :raises TS3TimeoutError:
        :raises TS3RecvError:
        """
        start_time = time.time()
        while not self._event_queue:

            if timeout is not None:
                remaining_time = timeout - (time.time() - start_time)
                if remaining_time <= 0:
                    raise TS3TimeoutError()
            else:
                remaining_time = None

            self._recv(timeout=remaining_time)

        return self._event_queue.pop(0) if self._event_queue else None
def wait_for_event ( self , timeout = None ) : start_time = time . time ( ) while not self . _event_queue : if timeout is not None : remaining_time = timeout - ( time . time ( ) - start_time ) if remaining_time <= 0 : raise TS3TimeoutError ( ) else : remaining_time = None self . _recv ( timeout = remaining_time ) return self . _event_queue . pop ( 0 ) if self . _event_queue else None