lib/isono/node_modules/job_channel.rb
# Send a new job request to the endpoint.
#
# @param [String] endpoint endpoint name created by JobChannel#register_endpoint()
# @param [String] command command name in the endpoint.
# @param [any] *args arguments to run the job.
# @yieldparam [RpcChannel::RequestContext] modify RPC request before sending. The
#   method will stop the current thread if it does not exist.
# @return [Rack::Request,String] Request object if the block is given.
#
# @example call job endpoint 'endpoint1'.
#  puts  submit('endpoint1', 'command1', 1, 2, 3) # => show Job ID
Send a new job request to the endpoint.
Send a new job request to the endpoint .
def submit(endpoint, command, *args, &blk)
        req = run(endpoint, command, *args) { |req|
          blk.call(req) if blk
        }
        req.request[:job_id]
      end
def submit ( endpoint , command , * args , & blk ) req = run ( endpoint , command , * args ) { | req | blk . call ( req ) if blk } req . request [ :job_id ] end
Send a new job request to the endpoint.
Send a new job request to the endpoint .
Request object if the block is given.
Request object if the block is given .
Rack::Request,String
endpoint
command
args
blk
modify RPC request before sending. The method will stop the current thread if it does not exist.
modify RPC request before sending . The method will stop the current thread if it does not exist .
example
call job endpoint 'endpoint1'. puts submit('endpoint1', 'command1', 1, 2, 3) # => show Job ID
call job endpoint ' endpoint1 ' . puts submit ( ' endpoint1 ' ' command1 ' 1 2 3 ) # = > show Job ID