Skip to content

credit lease SDK primitives: check / trackWithReservation / prewarm#121

Draft
bpapillon wants to merge 1 commit into
mainfrom
credit-lease-sdk-primitives
Draft

credit lease SDK primitives: check / trackWithReservation / prewarm#121
bpapillon wants to merge 1 commit into
mainfrom
credit-lease-sdk-primitives

Conversation

@bpapillon
Copy link
Copy Markdown
Contributor

@bpapillon bpapillon commented May 21, 2026

Three new methods on SchematicClient (prewarm / check / trackWithReservation), opt-in via a creditLeases config block. Existing checkFlag / identify / track unchanged. Lease-bearing checks require DataStream so the SDK has the cached flag + company to find the credit condition and substitute the balance for WASM eval; without it, check falls through to a plain checkFlag.

Cross-pod state sharing is supported via creditLeases.redisClient — when supplied, lease balance and the reservation table live in Redis, with atomic mutations driven by Lua scripts (check-and-decrement on tryReserve, consume-and-refund on consume). Without it, the SDK falls back to single-pod in-memory stores.

@bpapillon bpapillon force-pushed the credit-lease-sdk-primitives branch 8 times, most recently from 5915cef to 2b0ea18 Compare May 23, 2026 17:40
@bpapillon bpapillon force-pushed the credit-lease-sdk-primitives branch 10 times, most recently from 407a9fd to abdf779 Compare June 3, 2026 04:22
@bpapillon bpapillon force-pushed the credit-lease-sdk-primitives branch from fb41f64 to fd67284 Compare June 3, 2026 19:19
Client-side credit lease + reservation gating on check/trackWithReservation,
with in-memory or Redis-backed lease and reservation stores. Adds prewarm,
getCreditBalance (lease-aware, expired-lease safe), and lease-matched credit
selection on mixed-credit flags.
@bpapillon bpapillon force-pushed the credit-lease-sdk-primitives branch from fd67284 to 69651e0 Compare June 3, 2026 21:21
@bpapillon bpapillon self-assigned this Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant