Skip to content

Instantly share code, notes, and snippets.

@madper
Created November 29, 2021 13:09
Show Gist options
  • Save madper/3479bdde6c7afaf5474d97260dd27a1b to your computer and use it in GitHub Desktop.
Save madper/3479bdde6c7afaf5474d97260dd27a1b to your computer and use it in GitHub Desktop.
def run(args: List[String]): URIO[Random with Console with Console,ExitCode] = {
HttpClientZioBackend().flatMap { backend =>
for {
r <- random.nextIntBetween(0, urist.length - 1).flatMap( i => quickRequest.get(urist(i)).send(backend)).catchAll(e => putStrLn(e.getMessage())).forever.fork
_ <- r.join
_ <- backend.close()
} yield ()
}.exitCode
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment