eth-cscs / pyfirecrest

Python wrappers for the FirecREST API
https://pyfirecrest.readthedocs.io
BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

Provide methods for closing and create the httpx session in AsyncFirecrest #97

Closed ekouts closed 5 months ago

ekouts commented 5 months ago

One of the issues mentioned in https://github.com/eth-cscs/pyfirecrest/issues/94 .

The code that was failing could look like that:

...
async def get_systems():
    await _client.create_new_session()
    systems = await _client.all_services()
    await _client.close_session()

asyncio.run(get_systems())
asyncio.run(get_systems())