Exredis.Sub
Subscribe functions for exredis
Summary
psubscribe(client, channel, term) | Subscribe to a channel by pattern |
start(host \\ '127.0.0.1', port \\ 6379, password \\ [], reconnect \\ :no_reconnect, max_queue \\ :infinity, behaviour \\ :drop) | Connect to the Redis server for subscribe to a channel |
start_link(host \\ '127.0.0.1', port \\ 6379, password \\ [], reconnect \\ :no_reconnect, max_queue \\ :infinity, behaviour \\ :drop) | Connect to the Redis server for subscribe to a channel |
stop(client) | Disconnect from the Redis server: |
subscribe(client, channel, term) | Subscribe to a channel |
Types ↑
reconnect :: :no_reconnect | integer
max_queue :: :infinity | integer
behaviour :: :drop | :exit
start_link :: {:ok, pid} | {:error, term}
Functions
Specs:
- psubscribe(pid, binary, term) :: any
Subscribe to a channel by pattern
psubscribe(client, "some_channel_*", fn(msg) -> ... end)
start(host \\ '127.0.0.1', port \\ 6379, password \\ [], reconnect \\ :no_reconnect, max_queue \\ :infinity, behaviour \\ :drop)
Specs:
Connect to the Redis server for subscribe to a channel
start
start('127.0.0.1', 6379)
start('127.0.0.1', 6379, 'with_password')
start_link(host \\ '127.0.0.1', port \\ 6379, password \\ [], reconnect \\ :no_reconnect, max_queue \\ :infinity, behaviour \\ :drop)
Specs:
- start_link(list, integer, list, reconnect, max_queue, behaviour) :: start_link
Connect to the Redis server for subscribe to a channel
start_link
start_link('127.0.0.1', 6379)
start_link('127.0.0.1', 6379, 'with_password')
Specs:
- stop(pid) :: :ok
Disconnect from the Redis server:
stop(client)
Client is a pid getting from start command