Skip to content

Draft: [CSSTUDIO-2278] Async and sync Services for ArchiverAppliance

Sky Brewer requested to merge syncasyncservice into master

Swap ArchiverAppliance http client to all be aiohttp ClientSession

Part of https://jira.esss.lu.se/browse/CSSTUDIO-2278

The get statistics for a single IOC ability, requires requesting the pvDetails endpoint for each pv from the archiver. For small IOCs this doesn't take too much time, but even 100+ PVs the time taken increases a lot.

Solution to speed up the requests we use aiohttp which means, we can send all the requests and not wait for the response for a single one before sending the next.

To not produce breaking changes for the whole api, especially methods that are used most frequently at ESS. We add a sync wrapper around some of the ArchiverAppliance methods. To get this to work in a Jupyter context, requires setting up nest_asyncio. As Jupyter runs code on an asyncio thread.

Edited by Sky Brewer

Merge request reports