def AsyncPendingWrite(file):
    """
    Module function to check for data to be written.
    
    @param file The file object to be checked
    @type file
    @return Flag indicating if there is data waiting
    @rtype int
    """
    try:
        pending = file.pendingWrite()
    except Exception:
        pending = 0
    return pending
