In the docs for spawn it says "Note: This creates a relatively restricted 
kind of Process because it cannot receive any messages. More flexibility 
for user-defined processes will come in a later release!"

spawn : Task x a -> Task y Id

Am I also right in thinking that it cannot produce a result, or be run with 
Task.perform to produce any messages either? Since the 'a' argument gets 
chucked away.

I have a delayed task that refreshes a security token - so produces the 
token as a result. I want to cancel this task if the user logs out or fails 
authorization at any point prior to the refresh task completing. But I 
don't see a way to get both the token result and the Id for the task to 
pass to Process.kill.

Not such big deal, I found an alternative which is to check the auth state 
when refresh completes, and ignore the result if the user is no longer 
logged in.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to