Changelog
Released versions of the runstate TypeScript and Python SDKs and what changed in each.
Both SDKs are published as runstate-sdk (npm and PyPI), MIT licensed, and versioned together.
npm install runstate-sdkpip install runstate-sdkThese docs describe version 0.2.0. It works against the current hosted API (https://api.getrunstate.com); 0.1.x clients keep working against it too.
- Idle workers:
consume()long-polls (waitMs/wait_ms, default 20 s), so an idle worker makes a few requests a minute instead of polling everypollMs.receive()andadmit()accept a wait too. Empty waits and lease renewals don’t count toward the request rate. - Task groups:
group.close()andexpectedMembers/expected_members. AnN_ACCEPTEDgroup stays open until it is closed, reaches its expected members, or hits its deadline, and is only judged unreachable once closed.seal()is deprecated in favour ofclose(). - Runs:
scopes.create({ name })andchild({ name })store the name and return it in reads. - Admission: TypeScript
TaskRequirementsacceptsbudgetsandadmit()returnsreservations; Python exportsTaskRequirements,UnitsRequirementandBudgetRequirementtype hints. Pool units and the work-limit slot taken byadmit()are released when the task completes, is rejected or is retried (a server change; no SDK call needed). - Permissions:
ensure()for pools, quotas, work limits and budgets returns an existing matching resource when the key may not create one, and only raisesFORBIDDENwhen the resource does not exist.
- Python:
MailboxRef.receive()works. In 0.1.0 it raisedTypeErroron every call;consume()was not affected. - Both SDKs: waiting claim and pool acquisitions (
acquire({ wait: true }),run()) now also wait throughCONCURRENCY_LIMITED, retrying about once a second. - Both SDKs:
CONCURRENCY_LIMITEDandOPERATIONS_EXHAUSTEDmap toRateLimitError. - TypeScript low-level client: error codes are no longer collapsed to
UNAVAILABLEwhen the code was added to the contract after the client was written (for exampleINSUFFICIENT_BUDGET).
First public release of both SDKs: runs, claims, work queues and durable tasks, task groups, concurrency pools, shared quotas, work limits, budgets, barriers, timers, events and diagnostics; AsyncRunstate and the blocking Runstate client in Python; the low-level createRunstateClient in TypeScript.