
Security News
CISA Kills Off RSS Feeds for KEVs and Cyber Alerts
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Redis master-slave client for Ruby.
Writes are directed to a master Redis server, while reads are distributed round-robin across any number of slaves.
require 'redis_master_slave'
client = RedisMasterSlave.new(YAML.load_file('redis.yml'))
client.set('a', 1) # writes to master
client.get('a') # reads from slaves, round-robin
client.master.get('a') # reads directly from master
client.slaves[0].get('a') # reads directly from first slave
The client can be configured in several ways.
Ideal for configuration via YAML file.
client = RedisMasterSlave.new(YAML.load_file('redis.yml'))
Example YAML file:
master:
host: localhost
port: 6379
slaves:
- host: localhost
port: 6380
- host: localhost
port: 6381
Specify the host and port for each Redis server as a URL string:
master_url = "redis://localhost:6379"
slave_urls = [
"redis://localhost:6380",
"redis://localhost:6381",
]
client = RedisMasterSlave.new(master_urls, slave_urls)
Specify master and slave configurations as separate hashes:
master_config = {:host => 'localhost', :port => 6379}
slave_configs = []
{:host => 'localhost', :port => 6380},
{:host => 'localhost', :port => 6381},
]
client = RedisMasterSlave.new(master_config, slave_configs)
Each configuration hash is passed directly to Redis.new
.
You can also pass your own Redis client objects:
master = Redis.new(:host => 'localhost', :port => 6379)
slave1 = Redis.new(:host => 'localhost', :port => 6380)
slave2 = Redis.new(:host => 'localhost', :port => 6381)
client = RedisMasterSlave.new(master, slave1, slave2)
Copyright (c) George Ogata. See LICENSE for details.
FAQs
Unknown package
We found that redis_master_slave demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.