elm-phoenix icon indicating copy to clipboard operation
elm-phoenix copied to clipboard

Difference between channels and topics

Open ssbb opened this issue 6 years ago • 2 comments

Hi! I am trying to use it with Absinthe Subscriptions. But there is a problem related to channels - I want an ability to retrieve message from different topic but not join such channel.

screen shot 2018-02-16 at 8 08 26 pm

As you can see on screenshot we actually join only __absinthe__:control channel, but got subscription incoming data at __absinthe__:doc:62645988 topic. And I can't join it (and shouldn't).

Do you think it's possible to get data from different topic but same channel?

Thanks!

ssbb avatar Feb 16 '18 17:02 ssbb

I see the issue here. I think we could add special callback which can be added to Channel, e.g.

|> Channel.onAbsintheSubscription "__absinthe__:doc:62645988" myCallback

which would then add this to a new internal dictionary. Then you could hook into the selfMsg Receive case and trigger the callback.

I currently do not have the time to add this on my own, but I can review any Pull Request you come up with :)

saschatimme avatar Feb 16 '18 17:02 saschatimme

Checking how I can do it already :)

BTW do you think it should mention Absinthe at all? Just thought about something like

|> Channel.withExtraTopic "__absinthe__:doc:62645988" Receive

ssbb avatar Feb 16 '18 17:02 ssbb