main :: Eff _ Unit
main = void $ launchAff do
fiber <- forkAff $ do
mainT <- forkAff $ supervise do
traceAnyA "tick 1"
delay $ 1000.0 # Milliseconds
traceAnyA "tick 2"
delay $ 1000.0 # Milliseconds
void $ liftEff (throwException (error "die"))
traceAnyA "tick 3"
delay $ 1000.0 # Milliseconds
traceAnyA "tick 4"
delay $ 1000.0 # Milliseconds
void $ joinFiber mainT
traceAnyA "done"
void $ joinFiber fiber
traceAnyA "done 1"
This program produces the following output:
> pulp run
tick 1
tick 2
>
The thrown exception does not get rethrown when trying to joinFiber mainT or joinFiber fiber and the program just peacefully terminates. Expected it to rethrow the exception as soon as I joinFiber the offending fiber.
This behaviour does not occur when mainT is not supervised.
This program produces the following output:
The thrown exception does not get rethrown when trying to
joinFiber mainTorjoinFiber fiberand the program just peacefully terminates. Expected it to rethrow the exception as soon as IjoinFiberthe offending fiber.This behaviour does not occur when
mainTis not supervised.