Class: EMRPC::Server

Inherits:
Object show all
Defined in:
lib/emrpc/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Server

Returns a new instance of Server.



4
5
6
7
# File 'lib/emrpc/server.rb', line 4

def initialize(options)
  @address = options[:address] or raise ":address option is missing!"
  @wrapper = EventedWrapper.new(:backend => options[:backend])
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



3
4
5
# File 'lib/emrpc/server.rb', line 3

def address
  @address
end

#wrapperObject

Returns the value of attribute wrapper.



3
4
5
# File 'lib/emrpc/server.rb', line 3

def wrapper
  @wrapper
end

Instance Method Details

#startObject



9
10
11
# File 'lib/emrpc/server.rb', line 9

def start
  @wrapper.bind(@address)
end

#stopObject



13
14
15
# File 'lib/emrpc/server.rb', line 13

def stop
  @wrapper.kill
end