feat: add contrib.activity_cache for activity memoization#1376
Draft
saeedseyfi wants to merge 2 commits intotemporalio:mainfrom
Draft
feat: add contrib.activity_cache for activity memoization#1376saeedseyfi wants to merge 2 commits intotemporalio:mainfrom
saeedseyfi wants to merge 2 commits intotemporalio:mainfrom
Conversation
Activities aren't idempotent by default. When workflows retry or re-run, every activity executes again even when inputs haven't changed. This module provides content-addressed caching with shared remote storage via fsspec, as both a decorator and an interceptor. Closes temporalio#1374
Tests interceptor with real Temporal worker: - Verifies second call with same args is served from cache - Verifies @no_cache activities always execute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
temporalio.contrib.activity_cachemodule for content-addressed activity memoization with shared remote storage@cacheddecorator for explicit per-activity caching,CachingInterceptorfor transparent all-activity cachingkey_fnfor selecting which arguments matter for the cache keyfsspecfor storage (same approach as feat: add contrib.workdir for remote-backed activity workspaces #1375)Closes #1374
Test plan
memory://backend