Conversation
…rt is Phoenix Channel Implementation is based on abshinte_websocket library. fix uesteibar#33
…parate attribute Calling url on subscriber value did not work.
Abshinthe subscriptions implementation based on elixir library abshinthe websocket. uesteibar#33
…tion Just pass query variables to AbsintheWebSocket.SubscriptionServer.
Subscriptions
Now we can start several supervised subscriptions.
|
🎉 👏🏿 |
|
@churcho will do, but life has been rather crazy lately and haven't had the time yet :) |
Understandably so, I appreciate all the great work. |
Hi, any chance you can review this PR? I am trying to see if I can use this and stop relying on 3rd party apps for channel information push. |
|
@churcho you can try it for test using this:
|
uesteibar
left a comment
There was a problem hiding this comment.
Hey there! thanks for taking the time for this, sorry it took ages to review. Apart from the comment below, it'd be ace if we could add some tests to this, I don't feel confortable merging such a feature without any test examples.
| You can do subscriptions: | ||
|
|
||
| ```elixir | ||
| defmodule AddUserSubscription do |
There was a problem hiding this comment.
I'm probably missing something as to why we've chosen this API, but do you think we could make it so that the user can start it as a regular supervisor/process?
I'm not familiar with AbsintheWebSocket but as far as I can gather we can always import AbsintheWebSocket.Supervisor and build our own supervisor. wdyt?
There was a problem hiding this comment.
Hi @uesteibar AbsintheWebSocket does all the heavy lifting of WebSocket protocol implementation. This is why I decided to use this library.
AbsintheWebSocket.Supervisor does all the magic of WebSocket subscriptions. This is why it must be used.
There was a problem hiding this comment.
Regarding testing. As we only add a wrapper around AbsintheWebSocket.Supervisor, AbsintheWebSocket has all the tests.
As a proof that this wrapper works, I added it in this Absinthe repo as a integration test:
https://github.com/karlosmid/zoom/tree/master
README.md has all instructions about Absinthe subscriptions.
There was a problem hiding this comment.
@karlosmid I understand AbsintheWebSocket.Supervisor does the "magic", however I think we can still have our own supervisor by using import and thus allow folks to use them as regular processes.
Did you consider an API like the one defined in #33?
There was a problem hiding this comment.
regarding testing, I feel strongly that if this library offers an API, we do need tests that ensure it behaves as expected.
There was a problem hiding this comment.
Hi @uesteibar.
Do you agree that this is what I need to do:
- refactor https://github.com/karlosmid/neuron/blob/master/lib/neuron_subscription.ex to be aligned with Support subscriptions #33
- add unit test that will mock
AbsintheWebSocket.SupervisorandAbsintheWebSocket.SubscriptionServer.subscribeand testhandle_updatemethod call
There was a problem hiding this comment.
sounds good 👍 I'd also be fine if we test it without mocking AbsintheWebSocket.Supervisor, but it might be harder 😄
There was a problem hiding this comment.
@karlosmid did you get around to handling the 2 PR task lists?
Based on https://github.com/karlosmid/absinthe_websocket?organization=karlosmid&organization=karlosmid