neuron icon indicating copy to clipboard operation
neuron copied to clipboard

Support subscriptions

Open uesteibar opened this issue 5 years ago • 2 comments

It would be great to implement support for subscriptions using websockex. The usage could roughly be:

defmodule SubscriptionExample do
  use Neuron.Subscription

  @url "https://my.awesome.graphql/endpoint"
  @query """
  subscription {
    user {
      name
    }
  }
  """

  def start_link(state) do
    Neuron.Subscription.start_link(@url, @query, __MODULE__, state)
  end

  def handle_update(data, state) do
    IO.puts "Received Update - #{inspect data}"

    {:ok, state}
  end
end

Which would be very similar to how websockex works.

uesteibar avatar May 06 '19 14:05 uesteibar

Any update on this feature request?

churcho avatar Mar 18 '21 20:03 churcho

@churcho not really, I haven't gotten the time to get on this myself, although contributions are always welcome. I'll otherwise eventually build it, but I can't promise when 😄

uesteibar avatar Mar 19 '21 10:03 uesteibar