phoenix_pubsub v2.0.0 Phoenix.PubSub.Adapter behaviour View Source
Specification to implement a custom PubSub adapter.
Link to this section Summary
Callbacks
Broadcasts the given topic, message, and dispatcher to all nodes in the cluster (except the current node itself).
Returns a child specification that mounts the processes required for the adapter.
Broadcasts the given topic, message, and dispatcher to given node in the cluster (it may point to itself).
Returns the node name as an atom or a binary.
Link to this section Types
Link to this section Callbacks
broadcast(adapter_name, arg2, arg3, arg4)
View Sourcebroadcast( adapter_name(), Phoenix.PubSub.topic(), Phoenix.PubSub.message(), Phoenix.PubSub.dispatcher() ) :: :ok | {:error, term()}
Broadcasts the given topic, message, and dispatcher to all nodes in the cluster (except the current node itself).
child_spec(keyword)
View Sourcechild_spec(keyword()) :: Supervisor.child_spec()
Returns a child specification that mounts the processes required for the adapter.
child_spec
will receive all options given Phoenix.PubSub
.
Note, however, that the :name
under options is the name
of the complete PubSub system. The name of the process to
be used by adapter is under the :adapter_name
key.
direct_broadcast(adapter_name, arg2, arg3, arg4, arg5)
View Sourcedirect_broadcast( adapter_name(), Phoenix.PubSub.node_name(), Phoenix.PubSub.topic(), Phoenix.PubSub.message(), Phoenix.PubSub.dispatcher() ) :: :ok | {:error, term()}
Broadcasts the given topic, message, and dispatcher to given node in the cluster (it may point to itself).
node_name(adapter_name)
View Sourcenode_name(adapter_name()) :: Phoenix.PubSub.node_name()
Returns the node name as an atom or a binary.