Use the StreamExt.timeOut function to terminate the stream after the specified number of seconds between values elapsed.