glyff
Guaranteed Lightweight Yieldable Function Foundation.
A primitive for pausing async functions across process and request boundaries, and resuming them later from the same point.
Install
pip install glyff
glyff has no dependencies beyond the Python standard library.
Behavior
- Marked function calls are recorded in a session-scoped execution repository, keyed by function identity, arguments, and an ordinal among identical calls.
- Re-invoking the same completed call within the same session returns the recorded result instead of re-executing.
- An exception persists nothing: the interrupted call stays
STARTED(retried on resume), completed descendant work remains committed, and the original exception propagates. - To pause a session intentionally, raise an application-owned exception and
catch it outside the
Sessionblock.
Public API
| Name | Description |
|---|---|
Domain |
Versioned ownership boundary; its engrave marks a function. |
Session |
Async context manager that scopes a sequence of engraved calls. |
ExecutionId |
Identifier for a recorded function execution. |
DomainId |
A domain's persistent machine identifier. |
ExecutionName |
The recorded name of an engraved function. |
ArgumentsDigest |
Digest of a call's canonical arguments. |
Execution |
Aggregate Root for a recorded function execution. |
ExecutionStatus |
Enum: STARTED, COMPLETED. |
SerializedValue |
Serializer-neutral persisted value (results, metadata). |
CanonicalArguments |
A call's encoded canonical arguments, the preimage of its key. |
CanonicalArgumentValue |
A logical canonical value, including a fallback. |
CanonicalFallback |
A fallback representation in a canonical argument. |
Metadata |
Metadata entry owned by an Execution. |
ExecutionRepository |
Repository for execution aggregates. |
Transaction |
Active transaction boundary. |
TransactionProvider |
Provider used by TransactionScope. |
Serializer |
Protocol for value serialization. |
ArgumentCanonicalizer |
Contract for normalizing bound call arguments into a canonical form. |
CanonicalValue |
A value in the JSON data model. |
SessionId |
The name a session's records are stored under. |
glyff.migration carries the offline half: MigratableBackend and
SessionMigration for a store that can replace a session atomically,
SessionMigrator for what a session should become, and DomainMigration —
declared as the ExecutionShape pairs that changed shape — as the one glyff
ships.
See migration.
Every engraved function belongs to a domain, which owns and versions its records:
engrave = glyff.Domain("com.example.payments", version="3").engrave
The first call into a domain records that version for the session, and a later
call under a different one raises DomainVersionMismatchError rather than
migrating. See
migration.
Persistent boundaries should declare an identity such as
@engrave(name="chat.reply"), so Python function renames do not change recorded
keys. Without name, glyff derives it from the function's module and
__qualname__.
Extending
- For persistent storage, see
glyff-sqlite(production) andglyff-file-store(debug). - For Pydantic-typed serialization, see
glyff-pydantic. - Custom backends provide an
ExecutionRepository, aTransactionProviderandclaim_domain, usually through a small backend bundle. See the backends doc. glyff.testingcarries a conformance suite for each extension point, listed in the backends doc (planned: #36).
Status
Pre-1.0 — the API is unstable and will change. See the documentation for the guarantees and what is planned.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file glyff-0.15.0.tar.gz.
File metadata
- Download URL: glyff-0.15.0.tar.gz
- Upload date:
- Size: 73.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5ee5ed749ca90b4d74f1869d2f902eb7ed481aea431d16d261bf0e2cbd008eb
|
|
| MD5 |
5e68fbb76b1bc16e3e760b28fdd04a71
|
|
| BLAKE2b-256 |
1151a9f58e9ede4afb69bc7ebfb50e819aed65ac890b33c85e5b3a20067b4079
|
Provenance
The following attestation bundles were made for glyff-0.15.0.tar.gz:
Publisher:
publish-glyff.yml on nueruyu/glyff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
glyff-0.15.0.tar.gz -
Subject digest:
e5ee5ed749ca90b4d74f1869d2f902eb7ed481aea431d16d261bf0e2cbd008eb - Sigstore transparency entry: 2450688567
- Sigstore integration time:
-
Permalink:
nueruyu/glyff@43092897107a82d086876e60536c933a5d9ce28b -
Branch / Tag:
refs/tags/v0.15.0 - Owner: https://github.com/nueruyu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-glyff.yml@43092897107a82d086876e60536c933a5d9ce28b -
Trigger Event:
push
-
Statement type:
File details
Details for the file glyff-0.15.0-py3-none-any.whl.
File metadata
- Download URL: glyff-0.15.0-py3-none-any.whl
- Upload date:
- Size: 64.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be056596f6232a382e80dcb6ede3df8e02aa9f4cc5a1f71decd12023ea184e74
|
|
| MD5 |
0c08601d10e1a4a1f1a9328cc7fc2a6a
|
|
| BLAKE2b-256 |
1f99d6eef8d82901584817a7ed814658b3add1ec1628a2e0b9be7eeb4fe1fe69
|
Provenance
The following attestation bundles were made for glyff-0.15.0-py3-none-any.whl:
Publisher:
publish-glyff.yml on nueruyu/glyff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
glyff-0.15.0-py3-none-any.whl -
Subject digest:
be056596f6232a382e80dcb6ede3df8e02aa9f4cc5a1f71decd12023ea184e74 - Sigstore transparency entry: 2450688727
- Sigstore integration time:
-
Permalink:
nueruyu/glyff@43092897107a82d086876e60536c933a5d9ce28b -
Branch / Tag:
refs/tags/v0.15.0 - Owner: https://github.com/nueruyu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-glyff.yml@43092897107a82d086876e60536c933a5d9ce28b -
Trigger Event:
push
-
Statement type: