Poolder.PubSub.PhoenixAdapter (Poolder v0.1.16)

View Source

Phoenix.PubSub adapter for Poolder.PubSub. Allows Poolder.PubSub to be used as a Phoenix PubSub backend.

Usage

Add to your Phoenix application's config:

config :my_app, MyApp.Endpoint,
  pubsub_server: MyApp.PubSub

config :my_app, MyApp.PubSub,
  adapter: Poolder.PubSub.PhoenixAdapter,
  name: MyApp.PubSub

Or in your supervision tree:

children = [
  {Phoenix.PubSub, adapter: Poolder.PubSub.PhoenixAdapter, name: MyApp.PubSub}
]

You can now use Phoenix.PubSub functions as usual:

Phoenix.PubSub.subscribe(MyApp.PubSub, "room:lobby")
Phoenix.PubSub.broadcast(MyApp.PubSub, "room:lobby", {:msg, "hello"})

Summary

Functions

broadcast(server, topic, message)

broadcast_from(server, from, topic, message)

child_spec(opts)

direct_broadcast(server, node, topic, message)

link(server)

node_name(server)

subscribe(server, topic, opts)

unsubscribe(server, topic, opts)