Skip to content

Commit 4316bec

Browse files
committed
More TODO notes
1 parent 3e933e4 commit 4316bec

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/mcp/server/lowlevel/result_cache.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ class InProgress:
2424
class ResultCache:
2525
"""
2626
Note this class is a work in progress
27+
Its purpose is to act as a central point for managing in progress
28+
async calls, allowing multiple clients to join and receive progress
29+
updates, get results and/or cancel in progress calls
30+
TODO CRITICAL!! Decide how to limit Async tokens for security purposes
31+
suggest use authentication protocol for identity - may need to add an
32+
authorisation layer to decide if a user is allowed to join an existing
33+
async call
34+
TODO name is probably not quite right, more of a result broker?
2735
TODO externalise cachetools to allow for other implementations
2836
e.g. redis etal for production scenarios
2937
TODO properly support join nothing actually happens at the moment
@@ -34,6 +42,8 @@ class ResultCache:
3442
TODO keep_alive logic is not correct as per spec - results are cached for too long,
3543
probably better than too short
3644
TODO needs a lot more testing around edge cases/failure scenarios
45+
TODO might look into more fine grained locks, one global lock is a bottleneck
46+
though this could be delegated to other cache impls if external
3747
"""
3848

3949
_in_progress: dict[types.AsyncToken, InProgress]

0 commit comments

Comments
 (0)