This gem monkey patches Ruby’s built in XMLRPC::Client to be EventMachine + Fiber aware. If you are not using EventMachine (or the reactor isn’t running), then it will fallback to using XMLRPC::Client’s default implemenation (using Net::HTTP).
require "eventmachine" require "em-xmlrpc-client" EM.run do Fiber.new do client = XMLRPC::Client.new2("http://blah.com/api") result = client.call("someMethod", "arg1", 123) # Uses em-http-request. end.resume end client = XMLRPC::Client.new2("http://blah.com/api") result = client.call("someMethod", "arg1", 123) # Uses Net::HTTP like normal.
em-http-request is required if you want to use the EventMachine + Fiber aware implementation.
Christopher J. Bottaro
@cjbottaro
Copyright © 2017, Christopher J. Bottaro.
This project is licensed under the MIT License.