Created
June 5, 2022 12:36
-
-
Save kuceraf/902d5ac935fe3616677aa4e95073163d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
uuidSequence().forEach { value -> println(value) } | |
} | |
fun uuidSequence(): Sequence<UUID> = sequence { | |
while (true) { | |
Thread.sleep(100) | |
yield(UUID.randomUUID()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment