The take_until operator emits items from its source observable until another observable emits an item. The following figure shows the marble diagram of this operator:
Its prototype is the following:
Observable.take_until(self, other)
Here, other is an observable used to stop emitting items from the source observable.
Here is an example of the take_until operator:
numbers = Subject()trigger = Subject()numbers.take_until(trigger).subscribe( on_next = lambda i: print("on_next {}".format(i)), on_error = lambda e: print("on_error: {}".format(e)), on_completed = lambda: print("on_completed") ...