Redis.Sentinel.Monitor (Redis v0.8.0)

Copy Markdown View Source

Proactive sentinel failover monitor.

Subscribes to +switch-master on a sentinel instance and notifies the parent Sentinel connection to reconnect before the old connection fails.

Usage

Typically started internally by Redis.Sentinel:

{:ok, monitor} = Monitor.start_link(
  sentinel_host: "127.0.0.1",
  sentinel_port: 26379,
  group: "mymaster",
  notify: sentinel_pid
)

When a failover occurs, sends {:failover, group, new_host, new_port} to the notify pid.

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

stop(monitor)