Methods

Included Modules

Class Index [+]

Quicksearch

MessagePack::RPC::Client

Client is usable for RPC client. Note that Client includes LoopUtil.

Public Class Methods

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

  2. initialize(host, port, loop = Loop.new)

Creates a client.

    # File lib/msgpack/rpc/client.rb, line 29
29:         def initialize(arg1, arg2, arg3=nil)
30:                 if arg1.respond_to?(:build_transport)
31:                         # 1.
32:                         builder = arg1
33:                         address = arg2
34:                         loop    = arg3 || Loop.new
35:                 else
36:                         # 2.
37:                         builder = TCPTransport.new
38:                         address = Address.new(arg1, arg2)
39:                         loop    = arg3 || Loop.new
40:                 end
41: 
42:                 super(builder, address, loop)
43: 
44:                 @timer = Timer.new(1, true, &method(:step_timeout))
45:                 loop.attach(@timer)
46:         end
open(arg1, arg2, arg3=nil) {|client| } click to toggle source
  1. open(builder, address, loop = Loop.new) {|client }

  2. open(host, port, loop = Loop.new) {|client }

Creates a client, calls the block and closes the client.

    # File lib/msgpack/rpc/client.rb, line 54
54:         def self.open(*args, &block)
55:                 c = new(*args)
56:                 begin
57:                         block.call(c)
58:                 ensure
59:                         c.close
60:                 end
61:         end

Public Instance Methods

close() click to toggle source
    # File lib/msgpack/rpc/client.rb, line 63
63:         def close
64:                 @timer.detach if @timer.attached?
65:                 super
66:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.