I didn’t get any feedback, so there is a little more details:
This is part of my update function:
case msg of
SetTimeout ->
let
sleepTask =
Process.sleep (5 * Time.second)
spawnTask =
Process.spawn sleepTask
in
( { model | timedOut = False, sleepTask = Just sleepTask }
, Cmd.batch
[ Task.perform TimedOut sleepTask
, Task.perform GotId spawnTask
]
)
StopTimeout ->
case model.timeoutId of
Nothing ->
( model, Cmd.none )
Just id ->
( { model | timeoutId = Nothing }
, Cmd.batch
[ Task.perform Killed <| Process.kill id
, Task.perform Killed <| Process.kill id
]
)
-- ...
GotId id ->
( { model | timeoutId = Just id }, Cmd.none )
Here is the error I get:
Uncaught TypeError: Cannot read property 'ctor' of null
And there is the question:
Is it appropriate behavoir for Process package or just a bug?