Previously the RestClient inherited from an AsyncToSerialHelper utility class that provided methods for calling / wrapping sync and async functions synchronously. Due to the way I wrote the AsyncToSerialHelper class, it was possible to add an async function to the event loop that contained a reference to both the AsyncToSerialHelper instance and whatever coroutine was going to run. As a result if the coroutine had a longer lifetime than the AsyncToSerialHelper instance, the gc could never collect the AsyncToSerialHelper instance. Crucially this meant the AsyncToSerialHelper instance's finalizer method, __del__ would never run any tear down logic. To avoid this, the functionality of AsyncToSerialHelper was refactored into a module of functions.
fixes #238
hydrotools._restclient [3.1.0] - 2023-10-25
Removals
RestClient.close finalizers were removed as they are no longer necessary.
Changes
Loosen _restclient's aiohttp version dependency.
Functionality of AsyncToSerialHelper was refactored into a module of functions. To avoid creation of circular references.
Checklist
[x] PR has an informative and human-readable title
[x] PR is well outlined and documented. See #12 for an example
[x] Changes are limited to a single goal (no scope creep)
[x] Code can be automatically merged (no conflicts)
See #238 for background.
Previously the
RestClient
inherited from anAsyncToSerialHelper
utility class that provided methods for calling / wrapping sync and async functions synchronously. Due to the way I wrote theAsyncToSerialHelper
class, it was possible to add an async function to the event loop that contained a reference to both theAsyncToSerialHelper
instance and whatever coroutine was going to run. As a result if the coroutine had a longer lifetime than theAsyncToSerialHelper
instance, thegc
could never collect theAsyncToSerialHelper
instance. Crucially this meant theAsyncToSerialHelper
instance's finalizer method,__del__
would never run any tear down logic. To avoid this, the functionality ofAsyncToSerialHelper
was refactored into a module of functions.fixes #238
hydrotools._restclient
[3.1.0] - 2023-10-25Removals
RestClient.close
finalizers were removed as they are no longer necessary.Changes
_restclient
'saiohttp
version dependency.AsyncToSerialHelper
was refactored into a module of functions. To avoid creation of circular references.Checklist