lib/arachni/rpc/client.rb
# Calls a remote method and grabs the result.
#
# There are 2 ways to perform a call, async (non-blocking) and sync (blocking).
#
# @example To perform an async call you need to provide a block to handle the result.
#
#    server.call( 'handler.method', arg1, arg2 ) do |res|
#        do_stuff( res )
#    end
#
# @example To perform a sync (blocking), call without a block.
#
#    res = server.call( 'handler.method', arg1, arg2 )
#
# @param    [String]    msg
#   RPC message in the form of `handler.method`.
# @param    [Array]     args
#   Collection of arguments to be passed to the method.
# @param    [Block]      block
Calls a remote method and grabs the result.
There are 2 ways to perform a call, async (non-blocking) and sync (blocking).
Calls a remote method and grabs the result . There are 2 ways to perform a call async ( non - blocking ) and sync ( blocking ) .
def call( msg, *args, &block )
        ensure_reactor_running
        req = Request.new(
            message:  msg,
            args:     args,
            callback: block,
            token:    @token
        )
        block_given? ? call_async( req ) : call_sync( req )
    end
def call ( msg , * args , & block ) ensure_reactor_running req = Request . new ( message : msg , args : args , callback : block , token : @token ) block_given? ? call_async ( req ) : call_sync ( req ) end
Calls a remote method and grabs the result.
Calls a remote method and grabs the result .
msg
<not_specific>
args
<not_specific>
block
<not_specific>
<not_specific>
None
example
To perform an async call you need to provide a block to handle the result. server.call( 'handler.method', arg1, arg2 ) do |res| do_stuff( res ) end
To perform an async call you need to provide a block to handle the result . server . call ( ' handler . method ' arg1 arg2 ) do |res| do_stuff ( res ) end
example
To perform a sync (blocking), call without a block. res = server.call( 'handler.method', arg1, arg2 )
To perform a sync ( blocking ) call without a block . res = server . call ( ' handler . method ' arg1 arg2 )