Skip to content

Commit 06e4d6b

Browse files
Provide correct API for monitoring an LRO (database). (#4048)
1 parent 9ad75ca commit 06e4d6b

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

docs/spanner/database-usage.rst

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,26 +96,13 @@ Check on Current Database Operation
9696
The :meth:`~google.cloud.spanner.database.Database.create` and
9797
:meth:`~google.cloud.spanner.database.Database.update` methods of instance
9898
object trigger long-running operations on the server, and return instances
99-
of the :class:`~google.cloud.spanner.database.Operation` class.
100-
101-
You can check if a long-running operation has finished
102-
by using its :meth:`~google.cloud.spanner.database.Operation.finished`
103-
method:
99+
conforming to the :class:`~.concurrent.futures.Future` class.
104100

105101
.. code:: python
106102
107103
>>> operation = instance.create()
108-
>>> operation.finished()
109-
True
110-
111-
.. note::
104+
>>> operation.result()
112105
113-
Once an :class:`~google.cloud.spanner.instance.Operation` object
114-
has returned :data:`True` from its
115-
:meth:`~google.cloud.spanner.instance.Operation.finished` method, the
116-
object should not be re-used. Subsequent calls to
117-
:meth:`~google.cloud.spanner.instance.Operation.finished`
118-
will result in an :exc`ValueError` being raised.
119106
120107
Non-Admin Database Usage
121108
========================

0 commit comments

Comments
 (0)