Phoenix.PubSub.Redis (phoenix_pubsub_redis v3.0.1) View Source

Phoenix PubSub adapter based on Redis.

To start it, list it in your supervision tree as:

{Phoenix.PubSub,
 adapter: Phoenix.PubSub.Redis,
 host: "192.168.1.100",
 node_name: System.get_env("NODE")}

You will also need to add :phoenix_pubsub_redis to your deps:

defp deps do
  [{:phoenix_pubsub_redis, "~> 2.1.0"}]
end

Options

  • :url - The url to the redis server ie: redis://username:password@host:port
  • :name - The required name to register the PubSub processes, ie: MyApp.PubSub
  • :node_name - The required name of the node, defaults to Erlang --sname flag. It must be unique.
  • :host - The redis-server host IP, defaults "127.0.0.1"
  • :port - The redis-server port, defaults 6379
  • :password - The redis-server password, defaults ""
  • :ssl - The redis-server ssl option, defaults false
  • :redis_pool_size - The size of the redis connection pool. Defaults 5
  • :compression_level - Compression level applied to serialized terms - from 0 (no compression), to 9 (highest). Defaults 0
  • :socket_opts - List of options that are passed to the network layer when connecting to the Redis server. Default []
  • :sentinel - Redix sentinel configuration. Default to nil

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.