rx/operators/observable/debounce.py
def debounce(self, duetime) -> ObservableBase:
    """Ignores values from an observable sequence which are followed by
    another value before duetime.

    Example:
        >>> res = source.debounce(5000) # 5 seconds

    Args:
        duetime: Duration of the throttle period for each value
        (specified as an integer denoting milliseconds).

    Returns:
        The debounced sequence.
    """

    source = self

    def subscribe(observer, scheduler=None):
        scheduler = scheduler or timeout_scheduler
        cancelable = SerialDisposable()
        has_value = [False]
        value = [None]
        _id = [0]

        def on_next(x):
            has_value[0] = True
            value[0] = x
            _id[0] += 1
            current_id = _id[0]
            d = SingleAssignmentDisposable()
            cancelable.disposable = d

            def action(scheduler, state=None):
                if has_value[0] and _id[0] == current_id:
                    observer.on_next(value[0])
                has_value[0] = False

            d.disposable = scheduler.schedule_relative(duetime, action)

        def on_error(exception):
            cancelable.dispose()
            observer.on_error(exception)
            has_value[0] = False
            _id[0] += 1

        def on_completed():
            cancelable.dispose()
            if has_value[0]:
                observer.on_next(value[0])

            observer.on_completed()
            has_value[0] = False
            _id[0] += 1

        subscription = source.subscribe_(on_next, on_error, on_completed, scheduler)
        return CompositeDisposable(subscription, cancelable)
    return AnonymousObservable(subscribe)
Ignores values from an observable sequence which are followed by
    another value before duetime.

    Example:
        >>> res = source.debounce(5000) # 5 seconds

    Args:
        duetime: Duration of the throttle period for each value
        (specified as an integer denoting milliseconds).

    Returns:
        The debounced sequence.
    
Ignores values from an observable sequence which are followed by
another value before duetime.



Duration of the throttle period for each value
(specified as an integer denoting milliseconds).

The debounced sequence.
Ignores values from an observable sequence which are followed by another value before duetime . Duration of the throttle period for each value ( specified as an integer denoting milliseconds ) . The debounced sequence .
def debounce(self, duetime) -> ObservableBase:
    source = self
    def subscribe(observer, scheduler=None):
        scheduler = scheduler or timeout_scheduler
        cancelable = SerialDisposable()
        has_value = [False]
        value = [None]
        _id = [0]
        def on_next(x):
            has_value[0] = True
            value[0] = x
            _id[0] += 1
            current_id = _id[0]
            d = SingleAssignmentDisposable()
            cancelable.disposable = d
            def action(scheduler, state=None):
                if has_value[0] and _id[0] == current_id:
                    observer.on_next(value[0])
                has_value[0] = False
            d.disposable = scheduler.schedule_relative(duetime, action)
        def on_error(exception):
            cancelable.dispose()
            observer.on_error(exception)
            has_value[0] = False
            _id[0] += 1
        def on_completed():
            cancelable.dispose()
            if has_value[0]:
                observer.on_next(value[0])
            observer.on_completed()
            has_value[0] = False
            _id[0] += 1
        subscription = source.subscribe_(on_next, on_error, on_completed, scheduler)
        return CompositeDisposable(subscription, cancelable)
    return AnonymousObservable(subscribe)
def debounce ( self , duetime ) -> ObservableBase : source = self def subscribe ( observer , scheduler = None ) : scheduler = scheduler or timeout_scheduler cancelable = SerialDisposable ( ) has_value = [ False ] value = [ None ] _id = [ 0 ] def on_next ( x ) : has_value [ 0 ] = True value [ 0 ] = x _id [ 0 ] += 1 current_id = _id [ 0 ] d = SingleAssignmentDisposable ( ) cancelable . disposable = d def action ( scheduler , state = None ) : if has_value [ 0 ] and _id [ 0 ] == current_id : observer . on_next ( value [ 0 ] ) has_value [ 0 ] = False d . disposable = scheduler . schedule_relative ( duetime , action ) def on_error ( exception ) : cancelable . dispose ( ) observer . on_error ( exception ) has_value [ 0 ] = False _id [ 0 ] += 1 def on_completed ( ) : cancelable . dispose ( ) if has_value [ 0 ] : observer . on_next ( value [ 0 ] ) observer . on_completed ( ) has_value [ 0 ] = False _id [ 0 ] += 1 subscription = source . subscribe_ ( on_next , on_error , on_completed , scheduler ) return CompositeDisposable ( subscription , cancelable ) return AnonymousObservable ( subscribe )
Ignores values from an observable sequence which are followed by
another value before duetime.
Ignores values from an observable sequence which are followed by another value before duetime .
"""Ignores values from an observable sequence which are followed by
    another value before duetime.

    Example:
        >>> res = source.debounce(5000) # 5 seconds

    Args:
        duetime: Duration of the throttle period for each value
        (specified as an integer denoting milliseconds).

    Returns:
        The debounced sequence.
    """
self
duetime