jjzjj

synchrony

全部标签

rspec - 当在一个 RSpec 套件中调用多个 with_api() 测试时,Goliath 会破坏 em-synchrony/em-hiredis

我在使用RSpec测试GoliathAPI时遇到了奇怪的行为。我的一项测试如下所示:require'helper'describeScales::Dispatchdoit"shouldreturna404ifresourcewasnotfound"dowith_api(Scales::Server)doget_request(:path=>'/')do|client|client.response_header.http_status.should==404endendendit"shouldreturnaresource"doScales::Storage::Sync.set"/ex

ruby - 简单使用 EM::Synchrony#sync 会导致 'root fiber' FiberError——我的错?

这个程序require'em-synchrony'##v1.0.0require'em-hiredis'##v0.1.0moduleEventMachinemoduleHiredisclassClientdefself.connect(host='localhost',port=6379)conn=new(host,port)EM::Synchrony.syncconn.connectconnendalias:old_method_missing:method_missingdefmethod_missing(sym,*args)EM::Synchrony.syncold_method

ruby - 简单使用 EM::Synchrony#sync 会导致 'root fiber' FiberError——我的错?

这个程序require'em-synchrony'##v1.0.0require'em-hiredis'##v0.1.0moduleEventMachinemoduleHiredisclassClientdefself.connect(host='localhost',port=6379)conn=new(host,port)EM::Synchrony.syncconn.connectconnendalias:old_method_missing:method_missingdefmethod_missing(sym,*args)EM::Synchrony.syncold_method

ruby - 为什么这个 EventMachine Synchrony hiredis 示例返回 DefaultDefferable,而不是请求中的值?

我有这段代码:require'em-synchrony'require'em-synchrony/em-hiredis'EventMachine.synchronydoredis=EventMachine::Hiredis::Client.connectputsredis.class.nameredis.set('a','foo')putsredis.get('a')=='foo'##shouldbe'true'putsredis.get('c').nil?##shouldbe'true'EM.stopend如果将其存储在/tmp/reddy.rb的文件系统中,则执行以下操作:$rub

ruby - 我应该在 Goliath 中使用 EM::Synchrony::Multi 还是 EM::Synchrony::FiberIterator?

也许这是错误的方法,但我是tryingtoparallelizeem-hiredis使用EM::Synchrony::Multi或EM::Synchrony::FiberIterator在Goliath中放置和查找。但是,我似乎无法访问基本值initializedintheconfig.我不断收到method_missing错误。这是我正在尝试做的基本的淡化版本:/lib/config/try.rbconfig['redisUri']='redis://localhost:6379/0'config['redis_db']||=EM::Hiredis.connectconfig['us

Ruby Redis 与 em-synchrony 和 PubSub 问题

我正在使用Cramp框架以及Redisgem和em-synchrony以及WebSockets来构建与聊天相关的Web应用程序,但遇到了一些问题。考虑以下代码:classDrawingAction:synchrony)@publisher||=Redis.new(:driver=>:synchrony)@subscriber||=Redis.new(:driver=>:synchrony)enddefhandle_join(join_data)room_name=join_data[:room_name]@subscriber.subscribe(room_name)do|on|on.

ruby - EM :Connection (em-synchrony) 内的光纤

谁能解释一下为什么Redis(redis-rb)同步驱动程序直接在EM.synchronyblock下工作,但不在EM:Connection内工作?考虑下面的例子EM.synchronydoredis=Redis.new(:path=>"/usr/local/var/redis.sock")id=redis.incr"local:id_counter"putsidEM.start_server('0.0.0.0',9999)do|c|defc.receive_data(data)redis=Redis.new(:path=>"/usr/local/var/redis.sock")put

ruby - Sinatra Synchrony 与 Redis 连接池

这是使用SinatraSynchrony处理Redis连接池的正确方法吗??我的gemfile看起来像这样:gem'sinatra-synchrony'gem'hiredis'gem'redis'sinatra服务器文件使用经典风格的方法,通常看起来像这样:require'sinatra'require'sinatra/synchrony'require'redis/connection/hiredis'require'redis/connection/synchrony'require'redis'redis=EventMachine::Synchrony::ConnectionPo