Skip to content

cedarpy v4.12.2

Latest

Choose a tag to compare

@skuenzli skuenzli released this 14 Oct 15:42
· 13 commits to main since this release
f9a3af1

Added

  • With the new keyword-only release_gil=True, other Python threads run while Cedar validates policies or builds a handle, so asyncio.to_thread keeps an event loop responsive during those calls (#120). The default, False, holds the GIL for the whole call, as before. These entry points take it:

    • validate_policies
    • PolicySet.from_str, PolicySet.from_json_str and PolicySet.from_pst
    • Schema.from_str and Schema.from_json_str
    • Entities.from_json_str

    When another thread is busy, a released call typically waits about sys.getswitchinterval() (5 ms by default) to resume, so releasing pays off for calls that take milliseconds or more. Reading the arguments and building the result still hold the GIL. See the Threads and asyncio Guide (#121). Thanks @kousun12!

Full Changelog: v4.12.1...v4.12.2