Skip to content

Commit

Permalink
Undeprecate listen_for_events
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Beckmeyer <[email protected]>
  • Loading branch information
non-Jedi committed Apr 11, 2018
1 parent 95f4829 commit 401439f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions matrix_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from uuid import uuid4
import logging
import sys
import warnings

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -401,15 +400,18 @@ def add_leave_listener(self, callback):
self.left_listeners.append(callback)

def listen_for_events(self, timeout_ms=30000):
"""Deprecated. sync now pulls events from the request.
"""
This function just calls _sync()
In a future version of this sdk, this function will be deprecated and
_sync method will be renamed sync with the intention of it being called
by downstream code.
Args:
timeout_ms (int): How long to poll the Home Server for before
retrying.
"""
warnings.warn("listen_for_events is deprecated. Use _sync instead.",
DeprecationWarning)
# TODO: see docstring
self._sync(timeout_ms)

def listen_forever(self, timeout_ms=30000, exception_handler=None,
Expand Down

0 comments on commit 401439f

Please sign in to comment.