Sha256: 9be6916fe5ad7bb3afd743ef072198761f7849d80416f2c60387bb2ca5b44d5f
Contents?: true
Size: 977 Bytes
Versions: 3
Compression:
Stored size: 977 Bytes
Contents
module Protobuf module Rpc class EventedRunner def self.stop ::EventMachine.stop_event_loop if ::EventMachine.reactor_running? end def self.run(server) # Ensure errors thrown within EM are caught and logged appropriately #EventMachine.error_handler do |error| # raise error # if error.message == 'no acceptor' # raise 'Failed binding to %s:%d (%s)' % [server.host, server.port, error.message] # else # Protobuf::Logger.error(error.message) # Protobuf::Logger.error(error.backtrace.join("\n")) # end #end # Startup and run the rpc server ::EventMachine.schedule do ::EventMachine.start_server(server.host, server.port, ::Protobuf::Rpc::Evented::Server) end # Join or start the reactor yield if block_given? ::EM.reactor_running? ? ::EM.reactor_thread.join : ::EM.run end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
protobuf-2.0.0.rc3 | lib/protobuf/rpc/servers/evented_runner.rb |
protobuf-2.0.0.rc2 | lib/protobuf/rpc/servers/evented_runner.rb |
protobuf-2.0.0.rc1 | lib/protobuf/rpc/servers/evented_runner.rb |