Skip to content

Commit

Permalink
chg: [source] rename source behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
gallypette committed Oct 28, 2024
1 parent bae9ffe commit 0a66caa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/cocktailparty/catalog/redis_channel.ex
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
defmodule Cocktailparty.Catalog.RedisChannel do
use Cocktailparty.Catalog.SourceBase
use Cocktailparty.Catalog.SourceBehaviour
use GenServer

alias Phoenix.Socket.Broadcast
require Logger

@impl Cocktailparty.Catalog.SourceBase
@impl Cocktailparty.Catalog.SourceBehaviour
def required_fields do
SourceType
{:ok, required_fields} = Cocktailparty.Catalog.SourceType.get_required_fields("redis_pub_sub", "pubsub")
required_fields
end

def start_link(source) do
def start_link(%Cocktailparty.Catalog.Source{} = source) do
GenServer.start_link(__MODULE__, source, name: {:global, {:source, source.id}})
end

Expand Down
4 changes: 2 additions & 2 deletions lib/cocktailparty/catalog/source_behaviour.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Cocktailparty.Catalog.SourceBase do
defmodule Cocktailparty.Catalog.SourceBehaviour do
@moduledoc """
Defines the behavior for sources.
"""
Expand All @@ -7,7 +7,7 @@ defmodule Cocktailparty.Catalog.SourceBase do

defmacro __using__(_) do
quote do
@behaviour Cocktailparty.Catalog.SourceBase
@behaviour Cocktailparty.Catalog.SourceBehaviour

def required_fields, do: []

Expand Down
4 changes: 2 additions & 2 deletions lib/cocktailparty/catalog/stomp_subscribe.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Cocktailparty.Catalog.StompSubscribe do
use Cocktailparty.Catalog.SourceBase
use Cocktailparty.Catalog.SourceBehaviour
use GenServer

alias Phoenix.Socket.Broadcast
Expand All @@ -8,7 +8,7 @@ defmodule Cocktailparty.Catalog.StompSubscribe do
alias Barytherium.Frame
require Logger

@impl Cocktailparty.Catalog.SourceBase
@impl Cocktailparty.Catalog.SourceBehaviour
def required_fields do
SourceType

Expand Down

0 comments on commit 0a66caa

Please sign in to comment.