Skip to content

Commit 13bf771

Browse files
committed
Add longCount to RxScala
1 parent ba9331f commit 13bf771

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/Observable.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3870,6 +3870,16 @@ trait Observable[+T]
38703870
}
38713871
}
38723872

3873+
/**
3874+
* Returns an Observable that counts the total number of items emitted by the source Observable and emits this count as a 64-bit Long.
3875+
*
3876+
* <img width="640" height="310" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/longCount.png">
3877+
*
3878+
* @return an Observable that emits a single item: the number of items emitted by the source Observable as a 64-bit Long item
3879+
*/
3880+
def longCount: Observable[Long] = {
3881+
toScalaObservable[java.lang.Long](asJavaObservable.longCount()).map(_.longValue())
3882+
}
38733883
}
38743884

38753885
/**

0 commit comments

Comments
 (0)