Skip to content

Commit 45096ae

Browse files
committed
cross service clarification
1 parent f8119ce commit 45096ae

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ To understand its mechanics, see [How It Works](#how-it-works) and Check [Why th
4646

4747
## Features
4848

49-
- 🔑 **Smart Invalidation**: Instantly clears all function caches tied to an entity’s footprint
49+
- 🔑 **Smart Invalidation**: Instantly clears all unique function call caches tied to an entity’s footprint
5050
- 📋 **Custom ID Fields**: Support for entities with non-standard/composite ID field names
5151
- 🔒 **Custom Backend**: Custom backend support with Built-in Redis/Memory backends
5252
- 🔄 **Cross-Service Compatible**: Designed to play nice across services with traditional and simple payloads
@@ -292,16 +292,16 @@ get_user_from_auth(1)
292292
# In service B
293293
UserEntity = "user"
294294
@cache(entity=UserEntity)
295-
def get_filtered_user(some_user_filter): # Completely different function
296-
# id is 1 as a result of filter
297-
return {"id": 1, "name": "Sam Jones"}
295+
def get_filtered_users(user_ids): # Completely different function, but same logical entities
296+
297+
return [{"id": user_ids[0], "name": "Sam Jones"}, {"id": user_ids[2], "name": "Another Sam Jones"}]
298298

299-
get_filtered_user({'name': 'Sam Jones'})
299+
get_filtered_user([1, 2])
300300

301301
# In any of your services
302302

303303
# Given that your key_prefix is same everywhere,
304-
# it will invalidate all function calls in your platform where it returned user with ID of 1.
304+
# it will invalidate *all* function calls in your platform where it returned user with ID of 1.
305305
# see @cache.invalidates for more
306306
cache.invalidate("user", 1)
307307

0 commit comments

Comments
 (0)