
Security News
Node.js TSC Declines to Endorse Feature Bounty Program
The Node.js TSC opted not to endorse a feature bounty program, citing concerns about incentives, governance, and project neutrality.
Supply Chain Security
Vulnerability
Quality
Maintenance
License
This project was started because I needed an authenticating and routable proxy for Redis. The main feature is a high performance, eventable, pure Ruby, implementation of the complete Redis wire protocol using the same interface as hiredis/reader.
In the worst possible scenario of very small payloads, I was benching 30k GETs per second with pure ruby and 40k/s with hiredis/reader. With larger payloads, the performance gap narrows to zero.
Ruby Gem:
gem install ruby-redis
Server:
bin/ruby-redis
src/redis-test
Client example:
require 'redis' EventMachine.run { redis = EventMachine.connect '127.0.0.1', 6379, Redis::Client
redis.on_pubsub do |message| # case message[0] # when 'psubscribe' ... end
redis.set :pi, 3.14159 redis.get('pi') do |result| p result end redis.blpop('mylist', 1).callback do |result| p result EM.stop end.errback do |e| EM.stop raise e end }
Using hiredis/reader (only affects clients):
require 'hiredis/reader'
Fibers; compatible with em-synchrony:
require 'redis/synchrony' Redis.synchrony {
redis = EventMachine.connect '127.0.0.1', 6379, Redis::Client
sync = redis.synchrony
reply = check = nil until reply redis.watch 'mykey' x = sync.get('mykey').to_i redis.multi redis.set 'mykey', x + 1 redis.badcmd redis.get('mykey') {|result| check=result} reply = sync.exec end redis.close EM.stop p reply, check # ["OK", #, "4"], "4" }
Ruby to Redis type conversions:
String === Status reply
RuntimeError === Error reply String === Bulk reply Integer === Integer reply Array === Multi-bulk reply Hash === Multi-bulk reply to hgetall NilClass === Nil element or nil multi-bulk TrueClass === :1 FalseClass === :0
FAQs
Unknown package
We found that ruby-redis 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
The Node.js TSC opted not to endorse a feature bounty program, citing concerns about incentives, governance, and project neutrality.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.