Skip to content

Commit

Permalink
update async client example (#297)
Browse files Browse the repository at this point in the history
Co-authored-by: Nathanael Shim <[email protected]>
  • Loading branch information
nateshim-indico and Nathanael Shim authored Mar 12, 2024
1 parent 699a0b9 commit 74326f4
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions examples/aio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,14 @@

async def example_with_client():
"""
RECOMMENDED: use the client context manager to handle creation
Use the client context manager to handle creation
and cleanup
"""
async with AsyncIndicoClient(config=config) as client:
print(await client.get_ipa_version())
await example_1(client)


async def example_basic_client():
"""Manage creation and cleanup of the client yourself"""

# The .create() is required!
client = await AsyncIndicoClient(config=config).create()

# Note this is the equivalent to calling
# client = AsyncIndicoClient(config=config)
# await client.create()

print(await client.get_ipa_version())
await example_1(client)

await client.cleanup()


"""
Examples of fun async usage
"""
Expand Down

0 comments on commit 74326f4

Please sign in to comment.