Class Index [+]

Quicksearch

MessagePack::RPC::Server

Server is usable for RPC server. Note that Server is a SessionPool.

Public Class Methods

new(arg1=nil, arg2=nil) click to toggle source
  1. initialize(builder, loop = Loop.new)

  2. initialize(loop = Loop.new)

    # File lib/msgpack/rpc/server.rb, line 27
27:         def initialize(arg1=nil, arg2=nil)
28:                 super(arg1, arg2)
29:                 @dispatcher = nil
30:                 @listeners = []
31:         end

Public Instance Methods

close() click to toggle source
    # File lib/msgpack/rpc/server.rb, line 70
70:         def close
71:                 @listeners.reject! {|listener|
72:                         listener.close
73:                         true
74:                 }
75:                 super
76:         end
listen(arg1, arg2 = nil, arg3 = nil, arg4 = nil) click to toggle source
  1. listen(listener, obj = nil, accept = obj.public_methods)

  2. listen(host, port, obj = nil, accept = obj.public_methods)

    # File lib/msgpack/rpc/server.rb, line 48
48:         def listen(arg1, arg2 = nil, arg3 = nil, arg4 = nil)
49:                 if arg1.respond_to?(:listen)
50:                         # 1.
51:                         listener = arg1
52:                         obj      = arg2
53:                         accept   = arg3 || obj.public_methods
54:                 else
55:                         # 2.
56:                         listener = TCPServerTransport.new(Address.new(arg1,arg2))
57:                         obj      = arg3
58:                         accept   = arg4 || obj.public_methods
59:                 end
60: 
61:                 unless obj.nil?
62:                         serve(obj, accept)
63:                 end
64: 
65:                 listener.listen(self)
66:                 @listeners.push(listener)
67:                 nil
68:         end
serve(obj, accept = obj.public_methods) click to toggle source
  1. serve(dispatcher)

  2. serve(obj, accept = obj.public_methods)

    # File lib/msgpack/rpc/server.rb, line 35
35:         def serve(obj, accept = obj.public_methods)
36:                 if obj.is_a?(Dispatcher)
37:                         # 2.
38:                         @dispatcher = obj
39:                 else
40:                         # 1.
41:                         @dispatcher = ObjectDispatcher.new(obj, accept)
42:                 end
43:                 self
44:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.