Skip to content

Instantly share code, notes, and snippets.

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