Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gabisurita committed May 22, 2017
1 parent fe227e9 commit 704fa97
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This document describes changes between each past release.
8.1.0 (unreleased)
==================

- Nothing changed yet.
- Allow reading from batch contexts using the ``parse_results`` method. (#146)


8.0.1 (2017-05-16)
Expand Down
20 changes: 15 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -325,18 +325,28 @@ Batching operations
Rather than issuing a request for each and every operation, it is possible to
batch the requests. The client will then issue as little requests as possible.

Currently, batching operations only supports write operations, so it is not
possible to do the retrieval of information inside a batch.

It is possible to do batch requests using a Python context manager (``with``):

.. code-block:: python
with client.batch() as batch:
for idx in range(0,100):
for idx in range(0, 100):
batch.update_record(data={'id': idx})
A batch object shares the same methods as another client.
Reading data from batch operations is achived by using the ``parse_results`` method
available ater a batch context is closed.

.. code-block:: python
with client.batch() as batch:
batch.get_record('r1')
batch.get_record('r2')
batch.get_record('r3')
r1, r2, r3 = batch.parse_results()
Besides the ``parse_results`` method, a batch object shares all the same methods as
another client.

Retry on error
--------------
Expand Down

0 comments on commit 704fa97

Please sign in to comment.