It's not possible to abort requests using the HTTP library (yet). See this
issue[1] for some discussion.

[1] https://github.com/evancz/elm-http/issues/17

On Thu, 23 Jun 2016 at 15:29 barmin <[email protected]> wrote:

> Hello again,
>
> As an exercise for learning elm, I'm making a small app that aggregates
> the timetables of different bus and train lines on the same page.
>
> So when launching the program I Task.perform a bunch of Http.get's to get
> the departures from on online API.
>
> Now I want to allow the user to change the departure date and time with
> html inputs.
>
> My problem is: the API is sometimes very slow to answer, so it could
> happen that I get an answer to an "old" question after I get the answer to
> the current one...
>
> An obvious possibility would be to abort all pending tasks when sending a
> new bunch of requests... but I don't know if that's possible?
>
> Another possibility would be to tag the answers with the date/time of the
> question and discard them if they don't correspond to the current model.
>
> How would you seasoned elm devs handle this problem?
>
> Thanks,
>
> Matthieu
>
> --
> 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.
>

-- 
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