arosien commented on code in PR #696:
URL: https://github.com/apache/daffodil-vscode/pull/696#discussion_r1261635431
##########
server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala:
##########
@@ -99,25 +102,17 @@ object Parse {
}
val parse =
- IO.interruptibleMany {
- val parse_res = dp.parse(
+ IO.interruptibleMany(
Review Comment:
It's a rather niche method:
https://typelevel.org/cats-effect/api/3.x/cats/effect/IO$.html#interruptibleMany[A](thunk:=%3EA):cats.effect.IO[A].
When wrapping a method that blocks a thread you need to decide if that
computation is interruptible.
(This begs the question, does `parse` actually block the thread, waiting
until the infoset? In my tests using `interruptibleMany` was the only way to
kill a running parse.)
For these situations, you use `IO.blocking` if you don't care about
interruption, `IO.interruptible` if you want the thread to be interrupted at
most once, and `IO.interruptibleMany` if more than one thread interrupt should
be attempted.
It's a rather big hammer, but the current choice seems to work without (me)
knowing too much about the thread semantics of a parse.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]