Class: WasmDRb::InvokeMethod
- Inherits:
-
Object
- Object
- WasmDRb::InvokeMethod
- Defined in:
- lib/wasm_drb/invoke_method.rb
Instance Method Summary collapse
-
#initialize(drb_server, client) ⇒ InvokeMethod
constructor
A new instance of InvokeMethod.
- #perform ⇒ Object
Constructor Details
#initialize(drb_server, client) ⇒ InvokeMethod
Returns a new instance of InvokeMethod.
3 4 5 6 |
# File 'lib/wasm_drb/invoke_method.rb', line 3 def initialize(drb_server, client) @drb_server = drb_server @client = client end |
Instance Method Details
#perform ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/wasm_drb/invoke_method.rb', line 8 def perform @result = nil @succ = false if @block @result = perform_with_block else @result = perform_without_block end @succ = true if @msg_id == :to_ary && @result.class == Array @result = DRbArray.new(@result) end return @succ, @result rescue StandardError, ScriptError, Interrupt @result = $! return @succ, @result end |