streams.Stream

class streams.Stream(src: Callable[[], Optional[streams.contents]])

The Stream class representing a stream of data.

You can read from a stream like this:

from sensors import DistanceSensor

sensor = DistanceSensor(0)
stream = sensor.stream()

for value in stream:
    if value < 1:
        print("An object is close!")
next_event() Optional[streams.contents]

Returns the next value in the stream. Returns None if the stream is empty when called.