Module: DRb::DRbClientProtocol
- Includes:
- DRbProtocolCommon
- Defined in:
- lib/emdrb/emdrb.rb
Overview
Client protocol module
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#block ⇒ Object
Returns the value of attribute block.
-
#df ⇒ Object
Returns the value of attribute df.
-
#msg_id ⇒ Object
Returns the value of attribute msg_id.
-
#ref ⇒ Object
Returns the value of attribute ref.
Instance Method Summary collapse
- #connection_completed ⇒ Object
- #post_init ⇒ Object
- #receive_data(data) ⇒ Object
- #receive_obj(obj) ⇒ Object
- #send_request(ref, msgid, arg, block) ⇒ Object
Methods included from DRbProtocolCommon
#dump, #make_proxy, #obj_load, #receive_data_raw
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
769 770 771 |
# File 'lib/emdrb/emdrb.rb', line 769 def args @args end |
#block ⇒ Object
Returns the value of attribute block.
770 771 772 |
# File 'lib/emdrb/emdrb.rb', line 770 def block @block end |
#df ⇒ Object
Returns the value of attribute df.
771 772 773 |
# File 'lib/emdrb/emdrb.rb', line 771 def df @df end |
#msg_id ⇒ Object
Returns the value of attribute msg_id.
768 769 770 |
# File 'lib/emdrb/emdrb.rb', line 768 def msg_id @msg_id end |
#ref ⇒ Object
Returns the value of attribute ref.
767 768 769 |
# File 'lib/emdrb/emdrb.rb', line 767 def ref @ref end |
Instance Method Details
#connection_completed ⇒ Object
779 780 781 782 783 784 785 |
# File 'lib/emdrb/emdrb.rb', line 779 def connection_completed @connected = true send_request(@ref, @msg_id, @args, @block) @state = :succ @succ = nil @result = nil end |
#post_init ⇒ Object
773 774 775 776 777 |
# File 'lib/emdrb/emdrb.rb', line 773 def post_init @msgbuffer = "" @idconv = DRbIdConv.new @load_limit = DEFAULT_LOAD_LIMIT end |
#receive_data(data) ⇒ Object
811 812 813 |
# File 'lib/emdrb/emdrb.rb', line 811 def receive_data(data) return(receive_data_raw(data)) end |
#receive_obj(obj) ⇒ Object
799 800 801 802 803 804 805 806 807 808 809 |
# File 'lib/emdrb/emdrb.rb', line 799 def receive_obj(obj) if @state == :succ @succ = obj @state = :result else @result = obj @state = :succ @succ ? @df.succeed(@result) : @df.fail(@result) close_connection end end |
#send_request(ref, msgid, arg, block) ⇒ Object
787 788 789 790 791 792 793 794 795 796 797 |
# File 'lib/emdrb/emdrb.rb', line 787 def send_request(ref, msgid, arg, block) ary = [] ary.push(dump(ref.__drbref)) ary.push(dump(msg_id.id2name)) ary.push(dump(arg.length)) arg.each do |e| ary.push(dump(e)) end ary.push(dump(block)) send_data(ary.join('')) end |