@@ -514,13 +514,13 @@ trait SourceOps[+T] { this: Source[T] =>
514
514
}
515
515
c
516
516
517
- /** Returns the first element from this source wrapped in [[Some ]] or [[None ]] when the source is empty. Note that `headOption` is not an
517
+ /** Returns the first element from this source wrapped in [[Some ]] or [[None ]] when this source is empty. Note that `headOption` is not an
518
518
* idempotent operation on source as it receives elements from it.
519
519
*
520
520
* @return
521
521
* A `Some(first element)` if source is not empty or `None` otherwise.
522
522
* @throws ChannelClosedException.Error
523
- * When [[ receive ]] fails.
523
+ * When receiving an element from this source fails.
524
524
* @example
525
525
* {{{
526
526
* import ox.*
@@ -542,30 +542,30 @@ trait SourceOps[+T] { this: Source[T] =>
542
542
case t : T @ unchecked => Some (t)
543
543
}
544
544
545
- /** Returns the first element from this source or throws [[NoSuchElementException ]] when the source is empty. In case when the [[ receive ]]
546
- * operation fails with exception then [[ChannelClosedException.Error ]] is thrown. Note that `head` is not an idempotent operation on
545
+ /** Returns the first element from this source or throws [[NoSuchElementException ]] when this source is empty. In case when receiving an
546
+ * element fails with exception then [[ChannelClosedException.Error ]] is thrown. Note that `head` is not an idempotent operation on
547
547
* source as it receives elements from it.
548
548
*
549
549
* @return
550
550
* A first element if source is not empty or throws otherwise.
551
551
* @throws NoSuchElementException
552
- * When a source is empty.
552
+ * When this source is empty.
553
553
* @throws ChannelClosedException.Error
554
- * When [[ receive ]] fails.
554
+ * When receiving an element from this source fails.
555
555
* @example
556
556
* {{{
557
557
* import ox.*
558
558
* import ox.channels.Source
559
559
*
560
560
* supervised {
561
- * Source.empty[Int].head() // throws NoSuchElementException("cannot obtain head from an empty source")
561
+ * Source.empty[Int].head() // throws NoSuchElementException("cannot obtain head element from an empty source")
562
562
* val s = Source.fromValues(1, 2)
563
563
* s.head() // 1
564
564
* s.head() // 2
565
565
* }
566
566
* }}}
567
567
*/
568
- def head (): T = headOption().getOrElse(throw new NoSuchElementException (" cannot obtain head from an empty source" ))
568
+ def head (): T = headOption().getOrElse(throw new NoSuchElementException (" cannot obtain head element from an empty source" ))
569
569
570
570
/** Sends elements to the returned channel limiting the throughput to specific number of elements (evenly spaced) per time unit. Note that
571
571
* the element's `receive()` time is included in the resulting throughput. For instance having `throttle(1, 1.second)` and `receive()`
@@ -646,7 +646,7 @@ trait SourceOps[+T] { this: Source[T] =>
646
646
* @return
647
647
* A last element if source is not empty or throws otherwise.
648
648
* @throws NoSuchElementException
649
- * When source is empty.
649
+ * When this source is empty.
650
650
* @throws ChannelClosedException.Error
651
651
* When receiving an element from this source fails.
652
652
* @example
0 commit comments