'Asynchronously indexes the collection of documents.
Identical to put() except that it returns a future. Call
get_result() on the return value to block on the call and get its result.'

@datastore_rpc._positional(2)
def put_async(self, documents, deadline=None):

    if isinstance(documents, basestring):
        raise TypeError(('documents    must    be    a    Document    or    sequence    of    Documents,    got    %s' % documents.__class__.__name__))
    try:
        docs = list(iter(documents))
    except TypeError:
        docs = [documents]
    if (not docs):
        return _WrappedValueFuture([])
    if (len(docs) > MAXIMUM_DOCUMENTS_PER_PUT_REQUEST):
        raise ValueError('too    many    documents    to    index')
    request = search_service_pb.IndexDocumentRequest()
    response = search_service_pb.IndexDocumentResponse()
    params = request.mutable_params()
    _CopyMetadataToProtocolBuffer(self, params.mutable_index_spec())
    seen_docs = {}
    for document in docs:
        doc_id = document.doc_id
        if doc_id:
            if (doc_id in seen_docs):
                if (document != seen_docs[doc_id]):
                    raise ValueError('Different    documents    with    the    same    ID    found    in    the    same    call    to    Index.put()')
                continue
            seen_docs[doc_id] = document
        doc_pb = params.add_document()
        _CopyDocumentToProtocolBuffer(document, doc_pb)
    def hook():
        results = self._NewPutResultList(response)
        if (response.status_size() != len(params.document_list())):
            raise PutError('did    not    index    requested    number    of    documents', results)
        for status in response.status_list():
            if (status.code() != search_service_pb.SearchServiceError.OK):
                raise PutError(_ConcatenateErrorMessages('one    or    more    put    document    operations    failed', status), results)
        return results
    return _RpcOperationFuture('IndexDocument', request, response, deadline, hook)
