Determines if a tool is running synchronous or asynchronous. When a tool is synchronous, the results are automatically returned, but no other action may be taken until the tool has completed. All non-server tools are synchronous. Server tools may be asynchronous, meaning that once the tool has been submitted to the server, other functionality can be run without waiting, and the results must be explicitly requested from the server.


IsSynchronous (tool_name)
ParámetroExplicaciónTipo de datos

The name of the tool to determine if it is synchronous.

Valor de retorno
Tipo de datosExplicación

A return Boolean value of True indicates the tool is synchronous.

Muestra de código

IsSynchronous example

Determine if a server tool is running synchronous.

import time
import arcpy

# Add server toolbox from a local ArcGIS Server

# Create and load a recordset object for the tool's input
record_set = arcpy.RecordSet()

# Run the server tool
results = arcpy.BufferLines_mytools(record_set, "100")

# If the tool is asynchronous, wait until the task is finished (status = 4)
if not arcpy.IsSynchronous("BufferLines"):
    while results.status < 4:

# Get output from task and export to a feature class on disk
result = results.getOutput(0)"c:/temp/bufferlines.shp")

Temas relacionados