Sha256: a92d22a722277960794e24081a2aff5bb7e402ee75d456ddef1c12ccfda7b93b
Contents?: true
Size: 643 Bytes
Versions: 30
Compression:
Stored size: 643 Bytes
Contents
module Protobuf module Rpc class EventedRunner def initialize(options) @options = options end def run # Startup and run the rpc server ::EventMachine.schedule do ::EventMachine.start_server( @options[:host], @options[: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 def stop ::EventMachine.stop_event_loop if ::EventMachine.reactor_running? end end end end
Version data entries
30 entries across 30 versions & 1 rubygems