Skip to content

Commit 00c3815

Browse files
committed
Fixes wait async example
1 parent f349d3c commit 00c3815

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,13 @@ async def main():
7878
async with SearchClient.create(app_id, api_key) as client:
7979
index = client.init_index('articles')
8080

81-
results = await asyncio.gather(
82-
index.save_object_async({'objectID': 1, 'foo': 'bar'}),
83-
index.save_object_async({'objectID': 2, 'foo': 'foo'})
84-
)
81+
response = await index.save_objects_async([
82+
{'objectID': 1, 'foo': 'bar'},
83+
{'objectID': 2, 'foo': 'foo'}
84+
])
8585

86-
MultipleResponse(results).wait()
86+
for raw_response in response.raw_responses:
87+
await index.wait_task_async(raw_response['taskID'])
8788

8889
print(await index.search_async(''))
8990

0 commit comments

Comments
 (0)