用 goliath 的 plugin 运行的一个周期任务,周期是 1 秒
module Plugin
  class Query
    include RunQuery
    def initialize(address, port, config, status, logger)
    end
    def run
      EM.add_periodic_timer(1) do
        _run
      end
    end
  end
end
class QueryOrder < Goliath::API
  plugin ::Plugin::Query
  def response(env)
    [200, {}, "query_orders runing"]
  end
end
在_run 中会引用另外一个 gem: A gem A 中会有异步 http 请求
EM.run do
  http = EM::HttpRequest.new(url, connect_options).post(req_options)
  http.callback {......}
end
这样 gem A 就与 goliath 的周期任务冲突了,产生了 EM 的嵌套 有类似的 gem 吗?能够心跳运行,又跟 gem A 中的 EM 不冲突 求解
报错是
[:HTTP_ERROR, "connection closed by server"]