On Wed, Dec 28, 2016 at 10:29 AM, GordonBGood <gordonbg...@gmail.com> wrote:

> It looks like  the implementation of this StackOverflow answer
> <http://stackoverflow.com/a/40334086/549617> (ignore the question and
> relevance as it is old, but the calling a function `getParentPos ()` to
> get some answers through some JavaScript called through a port, which
> returns the answers through a subscription `parentPos`that fires a
> message to update should still work.  This is fine as long as there is only
> one subscription, but as Mark says there is no Event Manager so it would
> likely get confused if there were other subscriptions such as say
> `Timer.every`.
>
> If this worked generally, it would be an easy way to transfer to a long
> running program written in JavaScript, with that long running program able
> to fire progress reports back and even a different completion Msg, but
> would be fairly useless if it didn't work with other subscriptions without
> adding a lot of code.
>
>
But you can do that already with subscriptions. I mean, you can have a
subscription for every message you want to send to your Elm program.
To my understanding you can trigger the long running with a Cmd port and
listen on various other Sub ports for intermediary answers and completions.
You can use one port and push the data in a way that can generate multiple
types of messages (progress, completion) or you can use multiple ports
(e.g. one for progress, one for completion)



-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to