Simple use of EM::Synchrony#sync causes 'root fiber' FiberError — my fault?
问题 This program require 'em-synchrony' ## v1.0.0 require 'em-hiredis' ## v0.1.0 module EventMachine module Hiredis class Client def self.connect(host = 'localhost', port = 6379) conn = new(host, port) EM::Synchrony.sync conn.connect conn end alias :old_method_missing :method_missing def method_missing(sym, *args) EM::Synchrony.sync old_method_missing(sym, *args) end end end end EventMachine.synchrony do redis = EM::Hiredis.connect redis.set('foo', 'bar') puts redis.get('foo') EM.stop end dies