Created
November 29, 2021 13:08
-
-
Save madper/064547fc2ba3c29d5e848552b075b0ab to your computer and use it in GitHub Desktop.
downloader
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
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