@Synchronized fun consumeNext(consumer: (value: T) -> Boolean): Boolean
(source)
Invokes the given lambda with the next consumable value and marks the value as consumed if the lambda returns true.
consumer
- a lambda accepting a consumable value.
Return
true if the consumable was consumed, otherwise false.