-
-
Notifications
You must be signed in to change notification settings - Fork 84
Resolve undefined IO throwing behavior in the presence of async and non-termination #110
Open
Assignees
Labels
Description
Suppose we have the following IO tree:
IO<Object> throwImmediately = IO.throwing(new IllegalStateException("head fell off")); IO<Unit> parkForever = io((SideEffect) LockSupport::park); throwImmediately.discardL(parkForever).unsafePerformAsyncIO().join();
What should the result be? Should it throw, or block?
Intuitively, it feels like it should probably throw immediately, and why wouldn't it? Well, because there is asynchrony, and since discardL is just a sugary zip call, and since zip can only execute once both results have been computed, the backing future holding the thrown exception will never be interrogated, so the exception will never propagate.
Investigate whether or not a principled approach to parallel IO can also easily immediately propagate exceptions under the context of asynchrony without violating correctness.
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.