Skip to content

Commit

Permalink
Use Blocker for Process#waitFor in slurp
Browse files Browse the repository at this point in the history
`waitFor` [blocks the calling thread][1] so it is appropriate to
evaluate it on the available `Blocker`.

[1]: https://docs.oracle.com/javase/8/docs/api/java/lang/Process.html#waitFor--
  • Loading branch information
fthomas committed Jan 24, 2021
1 parent 1399f30 commit 42063b8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ object process {
.drain
}

val result = readOut >> F.delay(process.waitFor()) >>= { exitValue =>
val result = readOut >> blocker.delay(process.waitFor()) >>= { exitValue =>
if (exitValue === 0) F.pure(buffer.toList)
else {
val msg = s"'${showCmd(args)}' exited with code $exitValue"
Expand Down

0 comments on commit 42063b8

Please sign in to comment.