Skip to content

Commit ce0e70d

Browse files
committed
Make examples/sentinel.rb a standalone example.
1 parent a18cca8 commit ce0e70d

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+
at_exit do
4+
begin
5+
Process.kill(:INT, $redises)
6+
rescue Errno::ESRCH
7+
end
8+
9+
Process.waitall
10+
end
11+
12+
$redises = spawn("examples/sentinel/start")
13+
314
Sentinels = [{:host => "127.0.0.1", :port => 26379},
415
{:host => "127.0.0.1", :port => 26380}]
516
r = Redis.new(:url => "redis://master1", :sentinels => Sentinels, :role => :master)

0 commit comments

Comments
 (0)