AppController/lib/taskqueue_client.rb
# Wrapper for REST calls to the TaskQueue Server to stop a
# taskqueue worker on a taskqueue node.
#
# Args:
#   app_name: Name of the application.
# Returns:
#   JSON response.
Wrapper for REST calls to the TaskQueue Server to stop a
taskqueue worker on a taskqueue node.

Name of the application.
Returns:
JSON response.
Wrapper for REST calls to the TaskQueue Server to stop a taskqueue worker on a taskqueue node . Name of the application . Returns : JSON response .
def stop_worker(app_name)
    config = {'app_id' => app_name, 
              'command' => 'update'}
    json_config = JSON.dump(config)
    response = nil
    make_call(MAX_TIME_OUT, false, "stop_worker"){
      url = URI.parse('http://' + @ip + ":#{SERVER_PORT}/stopworker")
      http = Net::HTTP.new(url.host, url.port)
      response = http.post(url.path,
                           json_config,
                           {'Content-Type'=>'application/json'})
    }
    if response.nil?
      return {"error" => true, "reason" => "Unable to get a response"}
    end
    return JSON.load(response.body)
  end
def stop_worker ( app_name ) config = { 'app_id' => app_name , 'command' => 'update' } json_config = JSON . dump ( config ) response = nil make_call ( MAX_TIME_OUT , false , "stop_worker" ) { url = URI . parse ( 'http://' + @ip + ":#{SERVER_PORT}/stopworker" ) http = Net :: HTTP . new ( url . host , url . port ) response = http . post ( url . path , json_config , { 'Content-Type' => 'application/json' } ) } if response . nil? return { "error" => true , "reason" => "Unable to get a response" } end return JSON . load ( response . body ) end
Wrapper for REST calls to the TaskQueue Server to stop a
taskqueue worker on a taskqueue node.
Wrapper for REST calls to the TaskQueue Server to stop a taskqueue worker on a taskqueue node .
app_name
<not_specific>