Le 17/05/2017 à 09:15, Christophe de Vienne a écrit :
> 
> 
> Le 17/05/2017 à 08:24, Wojciech Piekutowski a écrit :
>> There's also https://github.com/fbonetti/elm-phoenix-socket/. It doesn't
>> use an effect manager, but apparently  because of that doesn't notify
>> about disconnection.
>>
> 
> Very interesting. One limit I see is that only one type of Msg can be
> emitted by the subscription, which forces to handle all the
> subscriptions in the same component.
> 
> In my case, I need the subscriptions to be initialized and used in
> various components. I think I found a way to do that, I will put it on
> github soon.
> 
> Another limit I an hitting with a non-effect module, and for which I see
> no solution, is when several messages arrive in a single websocket
> message. In this case we should emit several custom message for one
> incoming websocket message.
> 
> Fortunalely, I can temper with the server and make sure one nats message
> comes in as a single websocket message, which workaround the issue.
> 

So, I have a first version of a Nats module, which handles properly the
subscriptions (at least as I wanted it to).

https://github.com/orus-io/elm-nats

It is requires a nats/websocket gateway I wrote too
(https://github.com/orus-io/nats-websocket-gw)

The main thing that bothers me is that I will need to pass the
Nats.State to every update function because subscribing requires an
update of the state... And I see no way to avoid that except using an
effect module.

There are plenty improvements to do (starting with the documentation),
but some feedback would be really appreciated.

Thanks for all the helpfull response to my OP !

-- 
Christophe de Vienne

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