Skip to content

Commit e06bb07

Browse files
committed
Explain what the sentinel example does.
1 parent 34305a6 commit e06bb07

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

examples/sentinel.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
require 'redis'
22

3+
# This example creates a master-slave setup with a sentinel, then connects to
4+
# it and sends write commands in a loop.
5+
#
6+
# After 30 seconds, the master dies. You will be able to see how a new master
7+
# is elected and things continue to work as if nothing happened.
8+
#
9+
# To run this example:
10+
#
11+
# $ ruby -I./lib examples/sentinel.rb
12+
#
13+
314
at_exit do
415
begin
516
Process.kill(:INT, $redises)

0 commit comments

Comments
 (0)