[PR #21] [MERGED] Add async context manager to workflow context #53

Closed
opened 2026-02-16 02:16:24 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/workflows-py/pull/21
Author: @logan-markewich
Created: 7/2/2025
Status: Merged
Merged: 7/4/2025
Merged by: @logan-markewich

Base: mainHead: logan/async_ctx_manager


📝 Commits (4)

📊 Changes

3 files changed (+85 additions, -3 deletions)

View changed files

📝 src/workflows/context/state_store.py (+23 -1)
📝 tests/test_workflow_typed_state.py (+61 -1)
📝 uv.lock (+1 -1)

📄 Description

Adds an async manager to ensure locked access to the workflow state

async with ctx.store.edit_state() as state:
    state.val += 1
    await asyncio.sleep(0.01)
    if state.val % 2 == 0:
        state.val -= 1

Passes the state and sets the lock, saves the state, and then releases the lock


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/workflows-py/pull/21 **Author:** [@logan-markewich](https://github.com/logan-markewich) **Created:** 7/2/2025 **Status:** ✅ Merged **Merged:** 7/4/2025 **Merged by:** [@logan-markewich](https://github.com/logan-markewich) **Base:** `main` ← **Head:** `logan/async_ctx_manager` --- ### 📝 Commits (4) - [`c01b970`](https://github.com/run-llama/workflows-py/commit/c01b970c518d8eea5e198d17d651e27b62cb810a) Add async context manager to workflow context - [`6bf5fca`](https://github.com/run-llama/workflows-py/commit/6bf5fca22f456bbb25c666cfc4c9e90f22b15fb7) fix 3.9 tests - [`a6ed2cb`](https://github.com/run-llama/workflows-py/commit/a6ed2cb4b3c40a5eba249b2a89dae9fc5440d3d7) update docstring - [`6eac4dd`](https://github.com/run-llama/workflows-py/commit/6eac4ddedfcfdb4cd3db2f3d5132d343d65f0f5e) update to edit_state ### 📊 Changes **3 files changed** (+85 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/workflows/context/state_store.py` (+23 -1) 📝 `tests/test_workflow_typed_state.py` (+61 -1) 📝 `uv.lock` (+1 -1) </details> ### 📄 Description Adds an async manager to ensure locked access to the workflow state ``` async with ctx.store.edit_state() as state: state.val += 1 await asyncio.sleep(0.01) if state.val % 2 == 0: state.val -= 1 ``` Passes the state and sets the lock, saves the state, and then releases the lock --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 02:16:24 -05:00
yindo closed this issue 2026-02-16 02:16:24 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/workflows-py#53