Use the Eventmachine specific em-hiredis
gem instead of the default driver.
gem install em-hiredis
require 'em-synchrony'
require 'em-synchrony/em-hiredis'
redis = EM::Synchrony::ConnectionPool.new(size: 4) do
EM::Hiredis.new
end
Anywhere EM::Synchrony
is used, it is usually suggested to use the synchrony specific library shipped with em-synchrony
. That is why the statement em-synchrony/em-hiredis
and not require em-synchrony
.