You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `headOption` operator returns the first element in `Source` wrapped
in `Some` or `None` in case when source is empty or failed e.g.:
Source.empty[Int].headOption() // None
Source.fromValues(1, 2).headOption() // Some(1)
The `head` operator returns the first element in `Source` or throws
`NoSuchElementException` in case when it is either empty or `receive()`
operation fails without error. In case when `receive()` fails with
exception then this exception is re-thrown e.g.:
Source.empty[Int].head() // throws NoSuchElementException("cannot obtain head from an empty source")
Source.fromValues(1, 2).head() // 1
Note that neither `head` nor `headOption` are idempotent operations.
0 commit comments