Also, to the best of my knowledge, the only way to execute Tasks concurrently and independently is to use Cmd.batch. The ideas you provided execute the tasks one after another. Task.map3 is probably the closest to what I'm looking for, but it has to wait for all of the tasks to either fail or succeed.
On Friday, May 12, 2017 at 11:16:14 AM UTC-5, Peter Damoc wrote: > > Here are two approaches to just adding the texts (I'm assuming some > interface where you want to send a series of messages one after the other > and having the user seeing them arrive one after the other with some delay > between them) > > with subscriptions: > https://ellie-app.com/39PpTzWp5y3a1/0 > > without subscriptions: > https://ellie-app.com/39PpTzWp5y3a1/1 > > > > On Fri, May 12, 2017 at 6:36 PM, Frank Bonetti <[email protected] > <javascript:>> wrote: > >> If you batch a list of commands, they will be executed in reverse order. >> For example: >> >> Cmd.batch >> [ Task.perform (always (AddString "first")) (Task.succeed ()) >> , Task.perform (always (AddString "second")) (Task.succeed ()) >> , Task.perform (always (AddString "third")) (Task.succeed ()) >> ] >> >> Will print: >> >> third >> second >> first >> >> >> Has anyone else noticed this behavior? If so, do you know why Cmd.batch >> was implemented this way? >> >> Here's a demo: >> https://ellie-app.com/39NxYQfDCHMa1/0 >> >> -- >> 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] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > There is NO FATE, we are the creators. > blog: http://damoc.ro/ > -- 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.
