Skip to content

Add async asset store accessors for async tasks and watcher triggers - #72127

Open
jason810496 wants to merge 1 commit into
apache:mainfrom
jason810496:feature/task-sdk/async-asset-state-store-accessors
Open

Add async asset store accessors for async tasks and watcher triggers#72127
jason810496 wants to merge 1 commit into
apache:mainfrom
jason810496:feature/task-sdk/async-asset-state-store-accessors

Conversation

@jason810496

@jason810496 jason810496 commented Aug 27, 2026

Copy link
Copy Markdown
Member

Why

While reviewing #71135 and #71387, I realized that we should support the async methods for AssetStateStoreAccessor following the pattern of TaskStateStoreAccessor introduced in #68232.

How

  • Split each sync method into a _build_*_message helper plus a shared _extract_get_response, then have the sync method send() and the new async method await asend() the same message. No behaviour change on the sync path.
  • adelete/aclear await BaseStoreBackend.adelete/aclear, which already exist on the backend base class, and keep the DB-ref-first ordering of their sync counterparts.
  • Mirror the four methods on the AssetStateStoreAccessors facade. That is the object TriggerRunner injects as trigger_instance.asset_state_store, so it is what watcher triggers actually call.

Known gaps (inherited from #68232)


Was generative AI tooling used to co-author this PR?

@jroachgolf84

Copy link
Copy Markdown
Collaborator

@jason810496 - this is great, this is something I had on my radar when I originally ported in the Accessor for use with BaseEventTrigger's. Does this change the methods that a Trigger author would use to interact with the state store? i.e. aget rather than get?

@jroachgolf84

Copy link
Copy Markdown
Collaborator

This was my original PR: #68900

@jroachgolf84

jroachgolf84 commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

@jason810496, I think we'd need to allow for the async methods to be used from the Triggerer? Similar to what I did in my PR above?

cc: @amoghrajesh

@jason810496

Copy link
Copy Markdown
Member Author

Does this change the methods that a Trigger author would use to interact with the state store? i.e. aget rather than get?

Yes, but they can be done in the follow-up, since there're only two triggers using the Asset Store so far.
But they're kind of using in incorrectly (e.g. calling directly with the sync method within the async trigger.run method or using asyncio.to_thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants